Skip to content
Claude Code security

Claude Code security: what to check in an app it helped you build.

People mean two things by Claude Code security. One is the tool itself: what it may read, run and send while it works on your machine. The other is the app it wrote: whether a stranger can read your users' data, call your payment code or find a secret key. This guide covers both, in that order, and is honest about where the built-in reviews stop.

The short answer: the tool has guardrails, your app needs its own

Claude Code's permissions and sandbox protect your computer while it works. They say nothing about the app it produces. Anthropic's own help article says its automated reviews should complement, not replace, your existing security practices and manual review. So treat the tool settings and the app check as two separate jobs. Do both on your own app, or on an app whose owner has asked you to.

Part one: how Claude Code handles your machine.

Six facts from Anthropic's documentation that decide what the agent can touch. Settings change between versions, so check the current docs for your install.

Manual mode asks first

In Manual mode, Claude Code starts with read-only permissions and asks before it edits a file, runs tests or executes a command. Other modes trade prompts for speed: Accept Edits approves file edits and a short list of file commands inside the working folder, and bypassPermissions skips most prompts. Teams can switch bypass mode off for everyone in managed settings.

Deny beats allow

Permission rules are checked in a fixed order: deny, then ask, then allow. An allow rule can't open a hole in a deny rule. A rule such as Read(./.env) in the deny list keeps Claude's file tools away from your environment file.

A Bash rule is not a wall

Anthropic says so directly: a rule like Bash(curl *) stops curl https://... but not /usr/bin/curl or sh -c 'curl ...'. Read and Edit deny rules also don't stop a script that opens the file itself. And once you approve a Bash command, it can write anywhere your user account can.

The sandbox is off until you turn it on

Run /sandbox to put Bash commands behind an operating-system boundary: writes limited to the project folder, and network traffic through a proxy that only reaches domains you allow. It uses Seatbelt on macOS and bubblewrap on Linux and WSL2, and doesn't run on native Windows. It still lets commands read most of your machine, including ~/.ssh, unless you deny those paths.

MCP servers are your call

Claude Code asks before it trusts a new project folder or the MCP servers in a project's .mcp.json. Anthropic does not audit or manage any MCP server, so a server you add has the access you give it. Treat it like any other dependency.

Web content arrives as a summary

When Claude fetches a page, it gets a summary of the answer rather than the raw page, and network commands such as curl and wget are not approved automatically. That lowers the risk of a web page or file steering the agent, which is called prompt injection. It doesn't remove it.

Five settings to make before the next session.

They take a few minutes and close the gaps people most often leave open. The names are from Anthropic's docs.

1

Deny your secrets

Add deny rules for .env files, key files and anything holding a token, so Claude's file tools never read them. Then remember the limit above, and keep real production keys out of the project folder altogether.

2

Turn on the sandbox

Run /sandbox and keep the allowed domains to the package registry and the services the project really calls. Add deny rules for ~/.ssh, cloud credentials and other folders the agent has no reason to read.

3

Use a separate test project

Point the local app at a development Supabase or Firebase project, a Stripe test-mode key and test data. If something goes wrong in a session, it goes wrong somewhere that holds no customer data.

4

Keep bypass for throwaway work

Skipping prompts is fine in a disposable container. On the machine that holds your keys and your client work, stay in a mode that asks. A team lead can switch bypass mode off in managed settings.

5

Review every MCP server you add

Read what each server can do, who maintains it and which tokens it needs. Give it the narrowest token the service offers, and remove servers you no longer use.

Part two: what Claude Code can check in the code it wrote.

Anthropic offers three different things here. They are easy to mix up, and they don't cover the same ground.

Type /security-review in a session and Claude reviews the changes on your current branch against the default branch on origin, looking for risks such as injection, authentication problems and data exposure. It needs a git remote called origin.

Use it before every merge. Its strength is the diff: a new endpoint with no auth check, a query built from user input, a key added to front-end code. Its limit is the same diff. It looks at what changed, not at a rule that was wrong from the first commit.

Anthropic's open-source claude-code-security-review Action runs on pull requests, analyses only the changed files and posts findings as comments on the lines concerned. Its README lists the categories it looks for, including authentication and authorisation, data exposure, business logic such as race conditions, and supply chain issues. It filters out denial of service, rate limiting and open redirects as likely false positives.

One warning from the README matters: the Action is not hardened against prompt injection and should only review trusted pull requests. Turn on GitHub's setting that requires approval before workflows run for outside contributors.

In February 2026 Anthropic announced Claude Code Security, a scanner built into Claude Code on the web. It reads a whole codebase rather than a diff, traces how data moves through the app, checks each finding again before showing it, and gives it a severity and a confidence rating. Nothing is applied without a person approving it. At launch it was a limited research preview for Enterprise and Team customers, so many solo builders won't have it yet.
Each one reads code. None of them knows your business rules: that a customer must never see another customer's invoice, or that a team lead may only see their own team. None of them can see settings that live outside the repository, such as row level security policies created in the Supabase dashboard, or which key is set in your hosting provider. Those need a person and the live configuration.

Five things to check by hand in an AI-built web app.

This is where React apps on Supabase or Firebase with Stripe most often go wrong, whichever tool wrote them. Broken access control is number one in the OWASP Top 10:2025.

In a Supabase app the publishable key is meant to be public, and Supabase's docs say row level security decides what it can reach. So every table needs RLS on and policies that compare the row to the user, not just "signed in". Firebase's docs say the same about its rules: if true must never reach production, and a rule that only checks request.auth != null gives every signed-in user the whole database. Our Supabase RLS guide has the SQL to check each table and a two-user test.
In a Vite app, anything in a variable that starts with VITE_ is bundled into the JavaScript every visitor downloads, and Vite's docs say those variables must not hold secrets. Search your built files for sb_secret_, service_role, sk_live_ and any provider token. Supabase says a secret key never belongs in a browser or in source control. If one has been there, rotate it.
An assistant asked to "only let admins see this page" may hide the button and stop there. The data behind it is still one request away. Every permission must also hold where the data is: in the database policy, the Edge Function or the API route.
Stripe tells your app about payments through webhooks, and its docs say to verify each event with the Stripe-Signature header and the endpoint secret, using the raw request body. Many generated handlers parse the JSON first, which breaks verification, or skip it. Stripe also sends the same event more than once, so log the event IDs you have handled and skip repeats.
Software supply chain failures are number three in the OWASP Top 10:2025. An assistant adds packages as it goes. Before you merge, read the new lines in package.json, check each package is the one you meant, that it is maintained, and that the name is spelled the way its own project spells it. Commit the lockfile so every install gets the same versions.

Someone needs to know the app was checked?

If a customer, an investor or your own launch date needs more than a tool's comments, the sign-off review gives you a written go or no-go and the blockers ranked by risk, covering data access, sign-in, secret keys, payments and backups. It is readiness evidence, not a pentest and not legal advice. €990 excl. VAT, credited against a fix booked within 14 days, with a written scope and price before we start.
See the sign-off review

Built with Cursor instead? The same two jobs.

Cursor has its own controls for the agent and its own reviews for the code. The names differ; the limits are much the same.

Cursor's agent runs commands in one of three run modes: Auto-review, the default since version 3.6, where a classifier decides what needs your approval; Allowlist; and Run Everything. Cursor's docs carry a heading that says Auto-review is not a security boundary, because the classifier can make mistakes. Its terminal sandbox limits file writes and network access, using Seatbelt on macOS and Landlock on Linux kernel 6.2 or later.
Files listed in .cursorignore are kept from the agent, Tab and @-mentions, but Cursor's docs say its terminal and MCP tools cannot block access to them, and that complete protection isn't guaranteed. Keep production secrets out of the project folder here too.
Bugbot reviews pull requests for bugs, security issues and code quality, and comments with suggested fixes. By default its findings give a neutral check result, so it won't block a merge unless you set up branch protection to make it. Cursor's Security Review runs security reviewer agents on pull request events, and the /review-security command checks your branch before you push. Both read code, so the five hand checks above still apply.
Privacy Mode is about Cursor's use of your code, not your app's safety. Cursor says that with it on, it will not train on your data. Turn it on if your code includes anything a client would not want shared, but don't mistake it for a security review.

A routine that works with any AI coding assistant.

No tool covers everything. Layering cheap checks covers most of it, and leaves a person for the parts only a person can judge.

Write the rules down first

One line per table: who may read it, who may change it. Give the list to the assistant when it builds, and use it when you review. A review without rules can only find generic bugs.

Review every diff

Run /security-review or Cursor's /review-security before each merge, or the Action or Bugbot on each pull request. Read the findings; a comment that nobody acts on protects nothing.

Check the live settings

Once per release, look at what lives outside the code: RLS policies or Firebase rules in the console, which keys are set in the hosting provider, which webhook endpoints Stripe sends to. Then run the two-user test.

Have a person look before it matters

Before real users, real payments or a customer's questionnaire, someone who did not write the code should go through data access, sign-in, keys, payments and backups against your rules, with the owner's consent.

Questions about Claude Code security.

It can be, and it can also contain the same mistakes a hurried developer makes. The tool writes what it is asked for, and security rules are often the part nobody asked for. Review it the way you would review anyone's code: diff by diff, then as a whole before launch.
It is a good habit for every change. Before launch you also need a look at the whole app, including what was wrong before the branch started and the settings that live outside the repository. Anthropic's help article says its automated reviews should complement manual review, not replace it.
Its file tools can unless you deny it. Add a deny rule such as Read(./.env), turn on the sandbox, and keep production keys out of the project. Anthropic notes that deny rules don't stop a script that opens the file itself.
In a disposable container with no real keys, it saves time. On your main machine, keep a mode that asks, or turn on the sandbox so commands run inside a boundary. Approving a command means trusting it with everything your user account can do.
Both give you permission controls, a terminal sandbox and code reviews, and both say their automatic approvals are not a full security boundary. The bigger difference is usually how you set them up. Neither one checks your business rules for you.
No tool result says that. A review is one piece of readiness evidence about who can read which data. Whether the app meets the law is a legal question, and this guide is not legal advice.
Yes, if you own it or the owner agrees. It starts with a free 20-minute teardown. For a written verdict, see the sign-off review; to have the problems fixed, see Finish and fix, from €3,000. Webnorly is independent of Anthropic and Cursor and does not speak for them.

Sources

Last checked 19 November 2026. Both tools change often, so check the current documentation before you rely on a setting or a plan.

Claude Code: Security Manual mode, trust prompts, MCP, how web content is handled.
Claude Code: Permissions Modes, deny-ask-allow order, the .env rule, why Bash rules are not a boundary.
Claude Code: Sandboxing What the sandbox covers, its defaults and platforms.
Claude Code: Commands What /security-review reviews.
Claude Help Center: Automated security reviews Reviews complement manual review.
anthropics/claude-code-security-review The GitHub Action, its categories and its prompt injection warning.
Anthropic: Claude Code Security The research preview and who can use it.
Cursor: Run modes, Ignore files, Bugbot, Security Review and Security The Cursor section.
OWASP Top 10:2025 Broken access control and supply chain failures.
Supabase: API keys and Firebase: Avoid insecure rules Data access checks.
Vite: Env variables and modes Which variables reach the browser.
Stripe: Webhooks Signature checks and duplicate events.

Before real users sign in

Book a free teardown.

Tell us what your app does and which assistant built it. With the owner's consent, we spend 20 minutes on its riskiest part, usually who can read which data, and tell you what to fix first.