Reviewing a pull request you did not write
How a reviewed change can try to steer a review, what Kensa does to contain reviewers, what it does not do, and a checklist before you review a fork's pull request.
Reviewing a change means handing it to a model. When someone else wrote the change, that model reads text a stranger chose. This page explains the risk, what Kensa does about it, and what it does not do.
The risk
Everything a pull request carries is text its author chose: the code and its comments, the title and description, the branch name. Any of it can hold instructions aimed at the reviewer, which is called prompt injection. A reviewer that follows them could miss a real problem, report a false one, or, if it can run tools, read or send data it should not.
What Kensa does
- By default Kensa contains every reviewer, not only the reviewers of untrusted pull requests,
with one exception: Codex on Linux and Windows. Kensa has not measured Codex's own containment
on those platforms, so there Codex reviewers run only in reviews you start, as explained below.
How Kensa contains a reviewer depends on its agent CLI:
- Claude Code reviewers run with no shell, no web access and no file writes, and they load no user or repository settings, hooks or MCP servers. Quick reviewers get no tools; Deep reviewers get Read, Grep and Glob, limited to the checkout under review.
- On macOS, Codex reviewers run under a Kensa permission profile that Codex's own sandbox enforces: they read only the directory under review and what Codex itself needs, write nothing and have no network.
- Other agent CLIs run inside an OS sandbox, Seatbelt on macOS and bubblewrap on Linux. Most of them approve their own tools, a shell included, when they run unattended, so the sandbox is what limits them. They can write to temporary files, to the hidden folders in your home directory where CLIs keep their state (except Kensa's own and a list of files a later session loads) and, in Quick Review, to their own empty directory. They cannot read SSH and GPG keys, Kensa's credentials and settings, or a list of other tools' credential stores.
- Where no sandbox can contain one of these other CLIs, Kensa refuses it. A repository's Allow uncontained review agents, off by default, lets such a reviewer run in a review you start yourself, never in Auto-Review or a coding agent's request.
- Quick Review reads the diff. A Quick reviewer works from the pull request's diff, in a new, empty directory rather than your checkout.
- Deep Review reads a pinned checkout. On macOS and Linux, Deep Review of a pull request fetches its head into your clone with your own git, then reads a separate checkout pinned to that exact commit, created without running git hooks or setup scripts, and removed afterwards. For a fork's pull request, or one whose origin the code host does not report, that checkout's agent configuration is ignored and only Claude Code or Codex run. For a branch in the same repository, any agent CLI can run, and one that loads its project's configuration loads the checkout's, as it does in your own checkout. Claude Code reviewers load no project settings, hooks or MCP servers.
- Kensa itself does not run the code under review. No review installs dependencies, builds, type checks or runs tests. A reviewer whose CLI keeps its own shell, inside the OS sandbox or uncontained, could still run code if the change steered it to.
- The rules come from the base. Kensa reads repository guideline files such as
AGENTS.mdandCLAUDE.md, and the repository's own skills, at the commit the change is based on, so a pull request cannot rewrite the rules Kensa gives its reviewers. This needs a local clone. When a pull request edits a guideline file the review carries, reviewers are told to review the edit as a change to review policy. In a Deep review, an agent CLI that loads instruction files from its working directory may still read the head's own. - Pull request text is marked as data. The reviewer prompt fences text from the pull request as data to review, not instructions. That is a convention the model is asked to follow, not a barrier.
- Review agents get a reduced environment. Every review agent loses Kensa's own variables and
any variable whose name marks it as another tool's credential, such as a token, secret or API
key, except what its own CLI needs to sign in. On macOS and Linux, review agents also get no SSH
agent socket (
SSH_AUTH_SOCK) and no provider API keys from your login shell, only itsPATH, proxy and certificate settings. - Untrusted contributors get the safe defaults. When the code host reports that a pull request comes from a fork, does not say where its head comes from, or, on GitHub, comes from an author who is not an owner, member or collaborator, Kensa shows a banner, starts the review on Quick, never runs its reviewers uncontained, and never publishes its findings automatically. Deep Review of a fork runs only with Claude Code or Codex. See Pull requests from untrusted contributors.
- Findings reach agents as untrusted. When a coding agent requests the review,
get_reviewmarks its findingsuntrusted: true, telling the agent to treat them as claims to verify.
The containment alarm
Containment is set before a reviewer starts. While it runs, Kensa also checks every tool call the reviewer's agent CLI reports against the calls the alarm accepts from that reviewer, and raises an alarm when a call falls outside them. When the CLI's own report shows that such a call ran, Kensa also stops that reviewer.
-
What is watched. Every reviewer, and two stages beside them: Learn, which reads the change as the reviewers do, and the Consolidator, whose answer is what a review publishes. The Consolidator runs without reporting its tool calls, so the alarm sees only the calls its CLI reports it refused: Claude Code lists them, and each one is an alarm. Kensa never reports the Consolidator as having stayed inside its containment. The Verifier and the re-check of a review's earlier findings are watched too, but their alarms are only logged and do not change the review.
-
What the alarm accepts. These are the calls a reviewer may make without raising an alarm, not what the sandbox allows: the sandbox and the CLI's own settings are what refuse a call. A Quick Claude Code reviewer may call no tool, and a Deep one may read and search the checkout under review. Codex reviewers, and the reviewers of the CLIs in the OS sandbox that report their tool calls, may read, search and run commands. None of them may write files, use the web or call an MCP server.
-
What raises an alarm. A call outside what the alarm accepts, a path a tool call names outside the directory under review (for a Quick reviewer, outside the empty directory it runs in), an unknown tool, an MCP tool, or a path or input Kensa cannot read. So does a call the CLI reports it denied: Claude Code lists every call it refused. Once a reviewer has finished, Kensa also follows each path it read inside the directory to where it really leads, so a symbolic link to a file outside the directory raises one too. The skills and files Kensa gave a reviewer to read raise none.
-
What an alarm does. An alarm on a reviewer or on the Consolidator makes the review incomplete, so Auto-Review never publishes it. An alarm on Learn withholds that Learn analysis and leaves the review as it is: Learn's analysis is for you, never what a review publishes, and running Learn again replaces it. The review panel shows a notice that names each reviewer or stage that raised one, the kind of call and its path. In the Agents view, a reviewer's row counts every alarm it raised and lists the first 20 of them, one line each in its activity; the rest are counted, not listed. Paths are shown redacted, as the review trace keeps them.
-
An alarm alone is not a stop. An alarm alone does not stop the reviewer: when the CLI refused the call, or its report does not show that the call ran, the reviewer finishes and its findings stay. To clear the alarm, review the change again: accepting the review as it is leaves it incomplete. The check runs whether or not Record review traces is on.
-
When Kensa stops a reviewer. When a tool call outside the boundary ran, Kensa stops that reviewer alone; the other reviewers keep running. It is stopped the way a cancel stops it, and the agent slot it held goes to the next agent. What it found before the stop is kept, each finding marked stopped run, though a reviewer usually reports its findings only at the end, so a stopped one often has none. It is not retried automatically, and its backup provider does not take over: the boundary that did not hold once would not hold the second time. Retry pending runs it again, under the same boundary. Its row in the Agents view says it was stopped, the review panel's notice names it, and the review is never published automatically. A stop comes after the call ran, so it does not undo what the call did. Learn and the Consolidator are never stopped.
-
Which calls stop a reviewer. A stop needs the CLI's report that the call ran, and each agent CLI reports a different amount:
- Claude Code: only when the call’s own result reports that it succeeded. A call it refused, a call that failed and a call with no result never stop it.
- Codex: only a call its stream reports as completed, since Codex reports no call its sandbox denied. A call reported as failed or declined, or with any other status, never stops it: only a completed one counts as having run, though a failed command may have partly run and still raises its alarm.
- Cursor Agent, Gemini CLI, Qwen Code, OpenCode, Kilo Code CLI, Pi and Grok Build: when the call’s result
reports success. When the result does not say, only a call outside what the alarm accepts (a
write, the web or an MCP tool) stops the reviewer. On Gemini CLI and Qwen Code the likeliest stop is a web search or a
page fetch (Gemini CLI’s
google_web_searchandweb_fetch, Qwen Code’sweb_searchandweb_fetch): a reviewer may not use the web, and their result reports success. - Kimi Code reports a call’s result without saying whether it succeeded, so only a call outside what the alarm accepts stops it.
- Pi runs with its read, grep, find and ls tools only, so a shell command is outside what the alarm accepts too, and stops it once the command’s result reports success.
- Grok Build runs with its read_file, grep and list_dir tools only, so a shell command, a write
or its
search_toolanduse_toolare outside what the alarm accepts too, and stop it once the call’s result reports success. - ACP agent reports each call with the kind the agent itself names and no result, so a call outside what the alarm accepts raises the alarm and never stops the reviewer.
A path outside the directory, an unknown tool or an input Kensa cannot read stops a reviewer only when the call’s result reports success, on every agent CLI, Claude Code included: the alarm is Kensa’s own check for when an agent CLI’s permissions do not hold, so a read outside the directory that Claude Code allowed stops it too. Before a reviewer starts, Kensa looks up the real path of the directory under review, so a directory reached through a symbolic link, or spelled differently, is not mistaken for an outside path. If that lookup fails or takes too long, Kensa compares the spelling it was given. A call that hands work to the agent CLI’s own subagent raises an alarm but never stops a reviewer (OpenCode’s and Qwen Code’s
task, Gemini CLI’scodebase_investigator): its result says only that the subagent finished, and the subagent’s own calls stay inside the same sandbox, out of Kensa’s sight. Any other unknown tool whose result reports success stops it, since Kensa cannot tell what it did. A call the CLI refused never stops a reviewer, and neither does a symbolic link Kensa follows after the reviewer finished, or what Kensa could not check because a run was cut off, timed out or cancelled. The agent CLIs that report no tool calls are never stopped. Cursor Agent listing the MCP tools it holds raises no alarm; calling one of them is an MCP call. -
Letting unknown tools run with a warning. A repository can turn on Let unknown tools run with a warning in its Workspace settings, under Review setup. An unknown tool then still raises its alarm, shown as a warning, but never stops the reviewer, and a review whose only alarms are such warnings is complete. It applies only to a reviewer the OS sandbox contains with its network limited to its provider's API (Provider API only, where Kensa measured that provider's hosts on your system; Auto-Review's lane always is), on an agent CLI whose MCP calls Kensa can tell from other tools: today Cursor Agent, and Claude Code when Auto-Review runs it in the sandbox. It never applies to an untrusted contributor's pull request, to Learn or the Consolidator, to a network set to Unrestricted, or where no OS sandbox runs, as on Windows. A write, the web, an MCP call, a path outside the directory and an input Kensa cannot read stop a reviewer as before, and so does an unknown tool that names a path outside the directory.
-
What Kensa cannot see. The alarm sees only what an agent CLI reports. The alarm checks the paths a tool call names, not what a command run in a shell reads or writes: a command that reads outside the directory, or writes a file, raises no alarm, on Codex or on the CLIs in the OS sandbox. What such a command can write is what the OS sandbox or Codex's read-only mode allows. Codex does not report a command its sandbox denied, so Kensa never sees one. Augment Auggie, Aider, Goose, Crush, GitHub Copilot CLI, Factory Droid, Amp, Amazon Q, Antigravity CLI and Kiro CLI report no tool calls at all: their reviewers' rows say their tool use could not be observed, and Kensa never reports them as having stayed inside their containment.
What it does not do
- Containment does not keep the change from the model vendor. The agent CLI sends the review context to its provider under your account.
- Containment limits what a reviewer can do. It does not stop a prompt injection from distorting the findings: a finding can be wrong, or a real problem missing, because the change asked for it. Kensa's steering guard flags text that tries to steer the reviewers, in the change's added lines and in the pull request's title, description and comments, as a security finding that says it may be legitimate, and Auto-Review then publishes none of that review: a person does. A repository that legitimately holds such text lists the file globs the check ignores in its Review settings; the pull request's own text is always checked. The guard is a floor: a paraphrase passes it.
- By default, a review agent in the OS sandbox reaches only its provider's measured API hosts, and one whose hosts Kensa has not measured does not run. The default of Network for sandboxed review agents, Provider API only, runs only Cursor Agent among those CLIs on macOS, limited to its provider's measured hosts, and refuses the others there; on Linux, where no provider's hosts have been measured yet, it refuses all of them. A repository that needs one of them chooses Unrestricted, which gives it every host, or reviews with Claude Code. Setting it to Off for a repository makes Kensa refuse every one of those CLIs, Cursor Agent included.
- The OS sandbox blocks reads only of the listed credential locations. Other files on your computer stay readable to a sandboxed reviewer, and its own CLI's sign-in stays readable to it.
- Credential removal goes by variable name. A secret kept under an ordinary name, such as a connection URL with a password in it, is not removed.
- On GitLab, Bitbucket and Azure DevOps, Kensa reads no author permission level: a branch in the same repository counts as trusted, and only a fork, or a head whose origin the code host does not report, does not.
- On Linux, Codex reviewers run only in reviews you start, because Kensa has not measured their containment there. They run in Codex's read-only mode, which blocks writes but does not confine reads. Without bubblewrap installed, Kensa refuses the CLIs that need the sandbox, unless Allow uncontained review agents admits them.
- Windows has no OS sandbox for review agents. There, Auto-Review and coding agents' requests run
only Claude Code reviewers, Codex reviewers run only in reviews you start, in the same read-only
mode, and other agent CLIs are refused unless Allow uncontained review agents admits them for
a review you start, where they run uncontained; it never admits them for an untrusted
contributor's pull request. On Windows Kensa reads no login shell: review agents start from the
background engine's minimal environment, with the
PATH, proxy and certificate settings of the registry environment a fresh logon builds, and get no SSH agent socket and no provider API keys from your environment.
Before you review a fork's pull request
- Read the banner on the pull request. It says when Kensa treats the author as untrusted, and why.
- Start with Quick Review. It reads the pull request's diff, and its reviewers do not run in your checkout.
- If you need Deep Review, choose Claude Code or Codex for that run.
- Leave Allow uncontained review agents off. It never applies to an untrusted contributor's pull request, but on GitLab, Bitbucket and Azure DevOps any same-repository branch is trusted.
- Keep Auto-Review's Pull requests from untrusted contributors on Skip or Quick only, and leave their findings unpublished until you have read them.
- Read each finding as a claim to check against the code, and a clean review as no proof that the change is safe.