Skip to content

Security model

The unattended sessions are the trust boundary. Everything that reaches them is treated as untrusted, including the Sentry issue text they are asked to investigate.

The fire payload is data, not instructions

Section titled “The fire payload is data, not instructions”

All parameterization lives in the stored routine prompt, not in the request that triggers it. The payload carries five typed fields and no prose:

{ "project", "issue_ids", "release", "batch_id", "reply_token" }

The prompt instructs the session to treat any deviation from that shape as a malformed fire and report it rather than interpret it. This is the control that matters most, because the alternative design, passing instructions in the trigger, would make anyone who can reach the trigger endpoint able to reprogram the session.

The payload also sends issue ids rather than event bodies. That is partly the API’s 65,536-character cap on a fire, and partly that a full event body is attacker-influenced text; the session fetches what it needs through the Sentry connector instead.

The routines API exposes no configuration read

Section titled “The routines API exposes no configuration read”

There is no way to ask the API which repository a routine is bound to, or which connectors it has. So the receiver cannot assert at startup that the routine it is about to fire is the one it thinks it is.

The compensating control is a fail-closed probe: a session whose only job is to report its own configuration back. It is a manual gate, not an automatic one, and it needs re-running whenever the routine or the account’s connectors change. Naming it here rather than hiding it is deliberate, because a compensating control nobody knows to re-run is not a control.

The routine’s tool settings are in the same position as its connectors. The routine withholds every tool of the platform’s built-in GitHub server except one issue read, and the receiver cannot read that list. Reading the routine back through routine tooling proves the list was saved, not that the session runs under it, so the probe also lists the GitHub tools its own session can see and tries one it should not have, on an issue number that cannot exist. Re-run it whenever the investigator’s or the probe’s prompt or tool settings change.

Before posting findings anywhere, the session confirms the destination against two channels the operator controls and no injected text can forge:

  • SENTINEL_RECEIVER_URL, set in the cloud environment rather than passed in the fire
  • the environment’s deny-by-default egress policy, whose only non-default allowed host is the receiver

An instruction embedded in a stack trace telling the session to post its findings somewhere else fails both checks.

The check is narrower than it may look. The policy is deny-by-default over the hosts the operator controls; the environment still reaches whatever it defaults to reaching, and the investigation phase fetches the repository over the network before any of this. So the egress policy pins down where findings and fixes may be posted, since both go to the receiver, and it is not a general containment boundary. The fix phase adds no endpoint of its own: its one GitHub call is the fetch of the base branch, the same read the investigation already makes. The controls below are what carry the weight.

The session that writes the fix is the one that investigated

Section titled “The session that writes the fix is the one that investigated”

Autofix does not run in a second session started afterwards. The session that reported the findings writes the fix, using a grant the receiver returns in the HTTP response to that report, and hands the result back to the receiver to publish.

That shape follows from one fact about the runtime: the receiver can answer a session that calls it, but it cannot send a message to a session that is already running. A grant can only travel back down a request the session itself made, and the findings POST is the request there is. What travels is small on purpose: the repository, the base branch, the callback URL, and one grant per approved finding, each carrying a dispatch id and a one-time callback token. No credential is among them.

The session reads as the operator and holds no write credential

Section titled “The session reads as the operator and holds no write credential”

The session reaches GitHub two ways, and both are reads: the repository fetch, which the fix phase repeats for the base branch, and issue reads through the platform’s built-in GitHub tools, which authenticate as the operator. It never handles a token, and the platform’s own permission checks refuse token handling as credential exploration. The same built-in server offers tools that write, each of which would act under the operator’s name. The routine’s disallowed-tools list withholds every tool of that server except a short list of issue reads, so the session never sees a write tool, and the prompt forbids every GitHub write regardless, as the backstop for a tool the platform adds before the list catches up.

The session’s only GitHub operation in the fix phase is a fetch of the base branch, the same read the investigation makes. When the fix is written and its test passes, the session POSTs the changed files, whole, to the receiver’s callback route under the grant’s token, and reads back the outcome. It never pushes and never calls the pull request API, and the prompt says so in the plainest terms available: there is no legitimate write path from the session, so any push it makes is through the wrong one.

That is a statement about legitimacy, not capability. The platform’s GitHub proxy authenticates the session’s git traffic as the operator, and the platform documents that the proxy does not limit which branches a push can update; it leaves that to branch protection or rulesets on GitHub, applied to the operator’s own access, so a rule that access can bypass does not stop a session’s push. A session steered into running git push could therefore push as the operator to any branch the operator can update. What bounds that is the prompt’s prohibition and the target repository’s branch rules, not the routine’s configuration. Protect the branch fixes target with a rule the operator’s access cannot bypass. A push to some other branch stays possible, and shows up among the repository’s branches as the operator’s work, where it can be seen.

This is a stronger posture than the one it replaced, and it is worth saying why in one sentence. A credential live inside an attacker-influenceable session has to be contained by scope, lifetime, naming, and prose, and each of those is a mitigation for the credential being there at all; a session that holds no write credential needs none of them.

Reads run with the operator’s access, which is broader than the session needs, so the list of allowed reads is narrow on purpose. The platform limits its GitHub tools to the repositories attached to the session, and the routine withholds everything else the server offers, reads included, so the operator’s notifications, gists, and other repositories are out of reach of a session steered toward them. What the reads return is attacker-influenceable like a stack trace: anyone who can open or comment on an issue in the target repository writes text the session reads. The prompt treats it as data, and the most an injected issue can do is steer the session’s own draft, which reaches GitHub only through the receiver’s named operations.

The duplicate search is not one of those reads. The platform removes its GitHub server’s search tools from routine sessions and points them at gh api instead, a route that carries the same operator credential and can write as readily as it reads. Allowing it for searches would leave the prompt as the only thing standing between the session and a write under a person’s name, so the prompt forbids gh for reads too, and the receiver runs the search itself, as the App, with a token that can only read.

Scope one repository, the configured target_repo
Permissions per operation (OP_PERMISSIONS): contents: write and pull_requests: write for a pull request; issues: write for file_issue, comment, and reopen; issues: write plus the organization Issue fields read permission for set_fields; issues: read and organization_projects: write for add_to_project; issues: read alone for search; never workflows or any administration permission
Lifetime one hour, set by GitHub when the token is minted; spent inside the one invocation that minted it
Storage none: minted per pull request or per issue operation inside the receiver, never returned, never written down

For a pull request, the receiver mints it only after a fix_ready payload has passed validation and the dispatch record has been claimed, and spends it on one short sequence under a single time budget: a read of the base branch and a comparison that confirms the base commit is on it, a read of the base commit and its tree, a read of each base file a patch modifies, a blob per new or changed file, a tree that inherits the base commit and overrides only those paths, a commit, a branch, and then the pull request itself. The commit’s author is whatever GitHub records for the App installation, because nothing in the receiver sets one, so the pull request is the App’s by construction rather than by a check made afterwards.

For an issue operation, the receiver mints a token only after the request has passed validation, downscoped to what that one operation needs, and spends it on that operation’s few calls inside the same invocation. The App’s installation holds Issues read and write, organization Projects read and write, and organization Issue fields read-only for these. The organization permissions reach every project board and every issue-field definition target_repo’s owner has, not only the ones Sentinel uses. What confines the App’s board writes to the one configured board is the receiver’s named operations, which take the board from the operator’s config and never from a request.

workflows is absent deliberately. A workflow file pushed to a branch runs in CI, with access to the repository’s secrets, before any human reviews the pull request that carries it. A credential that can write .github/workflows/ is therefore not a code-writing credential at all; it is a secrets-reading one, and reviewing the pull request afterwards is too late to matter. The receiver also refuses any fix_ready path under .github/ before minting anything, on either side of a rename and in either payload form, so the scope is the enforcement behind a check that already said no.

The gate declines any finding that cites a path under .github/ too, but the three controls are not doing the same job. The gate’s path check reads the paths a finding claimed and declines early and legibly. The payload check reads the paths a fix actually carries, which is what matters, and it covers the operator’s excluded paths as well, which the token’s scope never could. The scope is what stands if both were somehow bypassed.

The webhook signature does not contain the content

Section titled “The webhook signature does not contain the content”

Sentry’s webhook is HMAC-verified, and it is worth being precise about what that buys. The signature proves the alert came from the Sentry integration. It proves nothing about the text inside the alert.

Stack traces and error messages routinely carry whatever user input caused the exception. That is what they are for. So anyone who can make the monitored application throw can put text of their choosing in front of an unattended session, through a channel that is fully authenticated and behaving exactly as designed. There is no signature check that helps here, and treating one as though it did would be the more dangerous error.

What contains it instead is everything downstream of the text: the receiver refuses a fix that touches a forbidden or excluded path, the token it mints reaches one repository and two permissions and never leaves the receiver, branch protection on the base branch means nothing lands without review, and a human reads the pull request before it merges. The prompt also tells the session to treat code, repository docs, Sentry text, and command output as data and to say in the pull request body when it saw something that read like an instruction, which helps a reviewer but is not itself a control.

The gate inputs this text can reach are the finding’s own confidence, fixability, and intent ratings, which the session supplies. Steering an investigation toward a diagnosis that looks confident, contained, and settled is the cheapest thing an injected instruction can attempt, and it is not something the receiver can second-guess: rating the finding is exactly the judgment the session was fired to make. What that buys an attacker is bounded, though. A flattering rating gets a finding to the gate; it does not get it past the operator controls below, which are evaluated on values the session never supplies.

The same holds for the source a settled intent names. The receiver checks that one is named, not that it says what the finding claims: reading it is the reviewer’s check, which is why the source leads the reply card’s details and the pull request body. The prompt tells the session that the error text and anything Sentry reports are never a source, which narrows what an injected sentence can offer as one but is not itself a control.

Confidence, fixability, and intent are the session’s own judgments and travel in the findings document, which is why the section above treats them as influenceable. Every other input to the decision is an operator control, and each one is evaluated in the receiver rather than in the prompt:

  • the kill switch that disables autofix entirely
  • the project allowlist
  • the forbidden and operator-excluded paths
  • the dedupe, so one issue earns one fix attempt per environment and release
  • the daily pull-request cap

The placement is the point. Text inside an investigated Sentry event can argue with a prompt; it can put a sentence in a stack trace claiming the cap is lifted or the project is opted in. It cannot argue with a conditional write in the receiver. Moving any of these into the prompt to make it “smarter” would move it inside the attacker’s reach.

The same reasoning covers the caps’ side effects: the dedupe and cap checks are conditional writes, spent as they pass, so a finding cannot be re-evaluated into a second attempt.

Urgency, the other rating a findings document carries, is the session’s own judgment too, formed over text an outsider can shape, exactly like confidence, fixability, and intent. It decides no receiver control: the gate never reads it, and its only effects are the findings reply card’s status line, the repeat-alert pointer, and the Priority of a new issue that a person triages.

The section above is accurate that those controls are evaluated on values the session never supplies, but it is worth being precise about which values are supplied. The gate reads the findings document, and the whole document arrives over one authenticated POST: the three ratings named above, and also each result’s status, the document’s schema_version, and the evidence file paths the path exclusions are matched against. Whoever holds a live reply token writes all of it. So the gate constrains the shape of a passing finding rather than proving one was investigated, and a document crafted to satisfy that shape earns what a genuine one earns.

What it earns is a grant: a dispatch id and a callback token that let the holder submit one fix_ready payload, from which the receiver will open one pull request. That is the whole prize. No credential leaves the receiver, and the payload is validated on the receiver before anything is minted: every path is checked against the forbidden and operator-excluded patterns, the file count and size are capped, symlinks and submodules are refused, and the branch name is computed from the record rather than read from the payload. What a forged finding can produce is therefore a pull request, authored by the App, containing files the forger chose, in a repository whose base branch is protected and whose reviewers read it. That is a real thing and it is bounded by review, which is the same thing that bounds a genuine fix.

Four things bound how far a stolen reply token gets before that point. It is stored only as a hash, so reading the table yields nothing usable. It is live only while its own batch is: the lookup requires a row still awaiting findings and still inside its deadline, checked on the request rather than left to the once-a-minute sweep, and a batch that has already been answered gets an empty autofix block rather than a second set of grants. It can only earn grants for the issues in its own batch, because the findings document is validated against that batch’s issue ids. And the dedupe and the daily pull-request cap are conditional writes, so how many grants any holder can extract is bounded by the operator’s cap rather than by how many documents they are willing to write.

The receiver validates what it is handed, and claims the record while it works

Section titled “The receiver validates what it is handed, and claims the record while it works”

A fix_ready payload is untrusted input from a session whose context held attacker-influenceable text, and the receiver treats it that way. The fix arrives as whole files or as a patch, and both forms pass through one path and mode policy, so neither can carry what the other refuses. Before any GitHub call it checks, in order: exactly one form, the shape, a full lowercase commit SHA for the base, at most twenty changed files, every path plain and repository-relative with no dot segments, every path clear of the forbidden and excluded patterns (a rename is checked on both sides, since moving a file out of a protected path changes that path too), no path twice, no mode but a regular or executable file, at most 512 KB of whole-file content or a 4 MB patch, a one-line title, and a bounded body. The first failure wins, the response names the rule, the record settles as failed, and the thread is told. Nothing is minted for a payload that fails.

A patch is parsed in full before that policy runs, and the parser refuses rather than guesses: leading text, an unknown header, a hunk whose lines disagree with its counts, a copy, or a binary change sent without its binary hunk all fail the payload. Binary hunks are compressed, so what all of them together may inflate to is capped before any is inflated, and the reverse hunks git adds for git apply -R are never inflated at all.

Some checks need GitHub and so run after the claim. The base commit the session built on must be the base branch’s head or an ancestor of it. A fix built on a commit that is not on the branch would open a pull request carrying unrelated changes, so the receiver opens nothing and the grant settles as failed. The base tree’s entry for every path the fix touches must be a regular file or absent, with no symlink or file above it, so no fix replaces or writes through a symlink, a submodule, or a directory, whichever form it came in. A patch must apply exactly: each file’s base blob must be the one the patch names, each hunk must match at exactly the line it names (no fuzz, no offset, no three-way merge), and each result must be the blob git recorded on the patch’s index line. A patch made against some other commit, or edited by hand, therefore fails rather than landing as something nobody tested, and the failure names the file. The whole sequence also runs under one time budget short of the function’s own limit, so a slow GitHub cannot leave a record claimed with no settle.

A payload that passes is opened under a claim. The receiver moves the dispatch record from dispatched to opening with a conditional write before its first GitHub call, under a fresh three-minute deadline, and settles it to pr_opened or failed afterwards. The claim is what keeps the timeout sweep from expiring a record the receiver is mid-way through, and the short deadline is what keeps a receiver that died mid-sequence from stranding the row: the sweep fails it, with a reply that says the receiver did not finish rather than blaming the session.

Authorship needs no check of its own. The App’s token is the only credential that opens the pull request, and the receiver is the only holder of it, so every autofix pull request is the App’s by construction. The detective control the previous design needed, a lookup of the pull request’s author after the fact, is gone with the reason it existed.

The residual exposure is the one already named: the pull request’s contents are chosen by a session that read attacker-influenceable text, and the receiver checks their paths and sizes, not their meaning. Review is the control for that, and branch protection is what makes review happen.

The callback is a capability, not an identity

Section titled “The callback is a capability, not an identity”

Each grant carries its own callback token, stored only as a hash and valid for that one dispatch. The receiver’s advance to a settled state is conditional, so a late callback and the timeout sweep cannot both write into a thread, and a replayed callback settles nothing twice. A grant that never reports is failed into the thread when its hour expires, which is the same principle as the investigation deadline: the failure mode worth engineering against is the silent one.

A finding that ends without a pull request is filed as a GitHub issue, and the session reaches that write only by asking the receiver for one of five named operations: file_issue, comment, reopen, set_fields, and add_to_project. A sixth, search, is the duplicate search, and only reads: its terms can carry no GitHub qualifier, so it runs over issues in target_repo alone, and it spends a per-alert cap but none of the day’s write budget. Each request carries a tracking token issued in the findings response, one per finding, stored only as a hash, scoped to that one alert, and expiring on its own. No operation closes, deletes, locks, or transfers an issue, or edits the text of an existing one, and set_fields and add_to_project act only on the issue the same grant created. Every call takes its repository from target_repo, refuses a redirect, and refuses a pull request posing as an issue. Attempts are capped per grant and per day, every title and body is redacted the way the findings reply is, and every body ends in the receiver’s footer naming the Sentry issue it came from. A footer-shaped line in the session’s text is dropped, so a session cannot point a post at a different issue.

That bounds what attacker-influenceable text can do through this path. The most it can steer is what a new issue says, which existing issue a comment lands on, which closed issue in target_repo is reopened, and which option a new issue gets in each field issues.fields lists (its Priority, and its Effort where that is configured), and a person triages all of it.

Receiver-side secrets live in SSM SecureStrings; workflow-side secrets are Actions secrets. Neither ever appears in the config file, which carries only a reference to the parameter name. The full inventory and the rotation runbooks are in Runbooks.

The optional alarm forwarder is the one outbound destination the alarm path adds. It sends an alarm’s description, name and time to an ntfy server, and nothing from an alert, a finding or a thread. On a public ntfy server the topic name is the only access control, so it is a SecureString like the credentials, and anyone who learns it can read those messages and publish to the topic. A subscriber that acts on what arrives should treat the content as untrusted, since a forged message is indistinguishable from a real one.

One non-credential is held the same way: the ban list tests/test_public_tree.py enforces splits its generic patterns, which are tracked, from the literals that would identify a real deployment, which live in an untracked local file mirrored by an Actions secret. A tracked ban list would be an index of everything it protects.

This repository’s disclosure gates are deterministic: a test bans specific strings and a scanner matches credential shapes. Both catch only what somebody already thought to describe, which is the wrong shape of defence against a prose page that quietly becomes a map of a deployment.

Nothing automated reads a change for that. Catching it is the author’s job, done by reading the diff before pushing, because on a public repository a pushed branch is already published. What to read for is the same list the string ban was written from: anything naming another repository’s internals, a real organization or account identifier, a live endpoint, or a measurement taken against a live system. Fixtures describe a fictional deployment for the same reason.

Please report anything you find through GitHub’s private vulnerability reporting rather than opening a public issue.