quiet robot

Recipe: Security check a repository

Scans a repository for risky code, leaked secrets and vulnerable packages; an agent fixes or explains each, and a person approves. What it does, when to use it, how to make it yours, and what a run costs.

View as Markdown

Scans a repository for risky code, passwords written into the code and packages with known vulnerabilities. An agent then reads the code behind each serious finding and either fixes it or explains why it's a false alarm. A recheck runs the scanners again, and a person decides whether to keep the fixes. The project's code is read, never run.

At a glanceNotes
LevelAdvanced
CategorySafety
ShapeScanners, an agent that fixes or explains, a recheck, a person
PlanFree and up
Needs a Claude keyYes
Limits it comes with2 loops, 1200 seconds, $0.50
Claude key limit for a run$1.00 of Claude
Commands that wait for a personPushing code
Security check a repository, as it is on the canvas.Get the repository (Run command), Run the scanners (Run command), Anything serious? (Decide), Agent fixes or explains (Agent), Fixed or explained? (Decide), Keep the fixes? (Approval), Keep the fixes (Run command), Report only (Run command), Nothing serious (Output). Arrows: Get the repository to Run the scanners; Run the scanners to Anything serious?; Anything serious? to Agent fixes or explains on Yes; Anything serious? to Nothing serious on No; Agent fixes or explains to Fixed or explained? on Done; Fixed or explained? to Agent fixes or explains on No; Fixed or explained? to Keep the fixes? on Yes; Keep the fixes? to Keep the fixes on Approved; Keep the fixes? to Report only on Denied.YesNoDoneNoYesApprovedDenied>_ RUN COMMANDGet the repository>_ RUN COMMANDRun the scanners◆ DECIDEAnything serious?◉ AGENTAgent fixes or explainsno internet◆ DECIDEFixed or explained?✋ APPROVALKeep the fixes?>_ RUN COMMANDKeep the fixes>_ RUN COMMANDReport only⚑ OUTPUTNothing serious
Security check a repository, as it is on the canvas.
Try it nowSimulateRun

Opens it in the Playground as a flow of your own. Simulate shows what a run costs. Run asks before it starts.

The steps

The pattern: scanners find, an agent fixes or explains, a recheck sends it back, a person keeps the result.

StepBlockWhat it does
Get the repositoryRun commandSaves a small sample shop API with known problems: a SQL query built from user input, a shell command, unsafe unpickling, MD5 for passwords, a hardcoded admin password and two outdated packages.
Run the scannersRun commandRuns bandit on the Python code, pip-audit on the pinned packages and a secrets scan, and writes security/findings.md. Nothing from the project is installed or run. If a scanner can't run, this step fails, so a run never reads "not checked" as "all clear".
Anything serious?DecideYes when there's at least one high or medium finding. No ends the run: nothing serious to fix.
Agent fixes or explainsAgentReads the code behind each high and medium finding. It fixes real problems with the smallest safe change, raises vulnerable package versions, and lists false alarms with a reason in security/accepted.txt. Then it writes security/REPORT.md. Its internet is off, and it can only read and edit files.
Fixed or explained?DecideRuns the scanners again. No sends the agent back while a high or medium finding is neither fixed nor explained.
Keep the fixes?ApprovalA person reads the report and the change, then approves or denies.
Keep the fixesRun commandCommits the fixes and saves them as security/fixes.patch.
Report onlyRun commandUndoes the fixes and keeps the report.

When to use it

  • Before you ship, or before you take over a codebase you didn't write.
  • After an AI agent has written a lot of code and you want a second look at it.
  • On every pull request, from a GitHub event trigger, so problems are caught early.

Run it

The quick way: choose Try it now under the drawing. It opens the recipe in the Playground as a flow of your own, after you sign in if you aren't yet. Simulate opens it and shows the forecast, and Run opens it and asks before it starts, with what the run will likely cost. From the dashboard instead:

  1. In the dashboard sidebar, open Agent Playground → Recipes and find Security check a repository. Choose Advanced to filter the list. In the builder, Recipes in the toolbar lists them too.
  2. Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
  3. If you haven't yet, save your Claude key on the Secrets page. The builder offers Add a key… in the step's key list if it's missing.
  4. Choose Simulate to see the forecast, then Run.
  5. When the run waits for a person, approve or deny it from the banner, from Approvals, or from the approval email.

What you'll see: Run the scanners finds 9 problems: 3 high, 4 medium and 2 low. Open Agent fixes or explains to follow the agent's turns. Fixed or explained? passes once nothing serious is left open, and the run waits for you at Keep the fixes?. Read security/REPORT.md and approve.

Make it yours

  1. In Get the repository, clone yours instead: git clone --depth 1 https://github.com/you/app app. For a private repository, save a GitHub token on the Secrets page as GITHUB_TOKEN and add it to the flow's secrets.
  2. Add scanners for your languages in Run the scanners and in Fixed or explained?, for example uvx semgrep scan --config auto --json -o security/semgrep.json app. Then teach .qr/summarize.py to read their output.
  3. For a deeper audit, replace Agent fixes or explains with a Run command that runs Claude Code with an audit skill, like the Claude Code to a pull request recipe.
  4. To get a pull request from it, add the Open the pull request step from Claude Code to a pull request after Keep the fixes. The flow holds git push for a person.
  5. The flow's key limit caps Claude at $1 a run. The Policy panel shows it, and you change it in the flow's JSON under policy.keyBudgets.

What a run costs

These are the builder's own forecast for the recipe as it comes, with its limits, rounded. Simulate shows the same numbers for your version, and they change as you change the flow.

NotesTypical1 in 10 runsAt most
Sandbox time$0.003$0.006$0.01
Claude, on your key$0.11$0.30the run's spend limit
How long it takesabout 5 minutesabout 7 minutes1200 seconds

A typical run uses $0.003 of sandbox time, so about 290 runs cost $1, and every plan includes $5 of usage a month. The time includes a person taking a minute or two to answer the approval. The clock, and the sandbox, keep running while the run waits. Claude is billed by Anthropic to your own key, at their usual prices. The run counts it toward its spend limit, so it can't overspend, but we don't charge you for it. At most is the most a run could cost with these limits: it stops at $0.50 or 1200 seconds, whichever comes first.

  • Agent PlaygroundQuickstart: build and run your first flow
  • Agent PlaygroundBlocks
  • Agent PlaygroundRecipes
  • SandboxesQuickstart: your first sandbox
  • SandboxesMCP server
  • SandboxesAPI reference
  • InsightsAll posts