Security

Rehearsal assumes the agent can be fooled and the data it reads can be hostile. Its job is to make sure neither can change live data without a person seeing exactly what would happen.

Threats and how each is handled

Threat model
ThreatWhat Rehearsal doesTested
Prompt injection hidden in data the agent readsEvery effect is rehearsed first and judged by what would change, not by the words that caused it. Prompt Guard adds an advisory flag and warns the agent.Yes
Mass changes that each look reasonableRules flag tasks that touch several customers, move large sums or change many rows, and a daily limit per customer counts payouts across tasks, so many small requests cannot add up unseen. High risk approvals need an explicit acknowledgement.Yes
Path injection through tool argumentsPath arguments must be plain identifiers of the right type, so 1/orders or ../admin never reach the app.Yes, 13 patterns
Destructive or bulk export endpointsOnly allow listed endpoints become tools. Customer export and permanent delete are never exposed.Yes
Model keys leaking to generated codeThe generated MCP server starts with only its base URL in its environment, and the protected app never receives Rehearsal's own keys or settings.Yes
Live data changing during reviewApproval re checks live against the snapshot and refuses if anything moved.Yes
A replay that fails, differs or crashesLive is restored from the pre approval snapshot and the restore is verified, even when the tool server dies part way through. If a restore cannot be confirmed, the snapshot is kept where a restart will not remove it.Yes
Losing track of work when Rehearsal restartsReviews still waiting, and applied work that can still be undone, are saved with their database copies and come back after a restart. Anything that can no longer be undone safely is not brought back.Yes
A runaway agentA hard limit on tool calls per task, enforced even inside a single model reply.Yes
Approvals forged from another websiteWrites need a per launch token and a JSON body, and requests for other host names are refused, which stops DNS rebinding.Yes
Someone else on the machine reading customer dataReading tickets, rehearsals or the audit log needs the same link. Without it the console only says that it is locked.Yes
Many runs started at once to exhaust the machineA place is held from the moment a run is accepted, so requests sent together cannot pass the limit on running rehearsals.Yes
An agent approving its own workThe approval token never reaches the agent. In MCP proxy mode the link that can approve opens in the person's browser, and the agent only learns the decision.Yes
Tampering with the recordThe audit log is hash chained, so an edited entry breaks the chain and the console says so. With REHEARSAL_AUDIT_KEY set the hashes are keyed, so the chain cannot be recomputed after an edit either.Yes
Targets planted in text the agent readsEvery id an action works on is traced to where the agent first saw it. Only id fields the app assigns count as the app's own data, so an order number in a message or a customer written subject is flagged.Yes
A reply that leaks or misleadsReplies carrying other customers' personal data are flagged, and so are replies or summaries that report money no change would pay.Yes
One person approving high risk work twiceWith two person approval on, each reviewer has their own secret link and the approver is whoever holds it, never a typed name. The shared console link cannot approve high risk work, and names such as Trust policy are reserved so nobody can sign as Rehearsal itself.Yes
Automatic approval going too farThe trust policy only applies work with no flag at all, from an agent that finished on its own, that never looked at other customers' records. New apps from rehearsal init start with it turned off.Yes

Known limits

We would rather say these plainly than have a reviewer find them.

  • Single writer during replay. Rehearsal assumes nothing else writes to live data during the fraction of a second a replay takes. Production use would add an app side lock or idempotency keys.
  • SQLite today. Shadow copies and diffs use SQLite. Other databases need a different snapshot method.
  • Names typed on the shared link are self reported. The launch token proves a request came from the console, not who sat at it. Reviewer links carry their holder's name, which is why two person approval only trusts them. A real deployment would sit behind single sign on.
  • Effects outside the database. Rehearsal sees what changes in the app's database. If an endpoint also sends an email or charges a card by itself, that happens on the private copy too, so such an app should point its copies at test accounts.
  • The newest audit entries. Removing entries from the end of the log does not break the chain. Production use would also copy the log to append only storage.
  • Prompt Guard sends text to Groq. When a Groq key is set, the text of tool results, customer messages included, is scored there. Set REHEARSAL_PROMPT_GUARD=0 or run fully offline to keep it on your machine.
  • Rules, not mind reading. Risk rules catch effects that look unusual. A harmful change that looks exactly like normal work still needs a careful reviewer, which is why every change is shown in full.
  • A reply applied by the trust policy cannot be unsent in a real system. In the demo store a reply is a row; in production it might be an email. The policy only lets through work with no flag at all, but a reply could still promise something without naming an amount. Set auto_apply = "none" if every reply must be read by a person.
  • Prompt Guard is advisory. It caught blatant injections in testing and missed the polite one in our demo, scoring it 0.14. That is exactly why it never decides anything on its own.

Found a problem?

Please open an issue on the GitHub repository. Do not include real customer data or secrets in reports.