viewer
The role with the fewest permissions. Can view runs, but cannot start them, make approval decisions or administer the system.
DesignWhat the AI can't change
02 of 05 · 2 min readThe service that talks to models has no GitHub write or shop-mitigation credentials. A separate service, action-runner, makes every change, and only for a plan a person approved. One more service to run, and the API still writes approvals.
Specialist agents call read-only tools. The service that runs them holds no GitHub write or storefront-mitigation credentials.
Cloud Logging, GitHub (read), Cloud Run revisions
The knowledge index in AlloyDB
Code redacts secrets from tool output before it is stored or sent to a model, and screens it for prompt injection. A tainted line can never support an action.
Secrets are redacted before storage and before any model sees them
Text that looks like instructions marks a line tainted
Every model attempt, retries and fallbacks included, reserves budget before it is sent. validate_proposal checks the plan against the action catalog, the patch and the citations.
Every model attempt reserves budget first
validate_proposal checks the action catalog, patch and citations
An approver signs off on the exact plan. The decision is tied to the proposal's digest, a fingerprint of its content. Any change to the plan voids the approval. It expires after 15 minutes.
Bound to the proposal's digest
Expires after 15 minutes
action-runner re-checks the approval before each action, then applies the mitigation and opens the pull request. It holds the write credentials and calls no model. Its limit: triage-api writes approvals, so a compromised triage-api could forge one (ADR 0011).
Re-checks the approval before each action
Holds the GitHub and storefront write credentials
Calls no model
Steps appear in order. Evidence, review and outcomes remain visible.
Evidence / agent workWaiting for a personFailingRecovered
THE TRADEOFF
A prompt injection or a wrong answer cannot change the store or the code without an approval. Every write needs an approval bound to the exact plan.
One more service to run. triage-api writes the approvals, so if it were compromised it could forge one (ADR 0011).
The alternative: give the agents write tools directly. Fewer moving parts, but the process that talks to models would hold the keys.
ONE RESULT
Only action-runner holds the GitHub and storefront write credentials; the API that talks to models has none of them.
limitSecret access is set in Terraform; no staging test probes it. The API still writes its own database, including approval rows, so a compromised API could forge one; it holds no write credential for GitHub or the shop.
See the approval and the writes in a recorded run ↗The evidence →
WHAT THIS DOES NOT CLAIM
MORE DETAIL
SIGN-IN AND ROLES
People sign in with Google through Firebase Auth. triage-api verifies the ID token on every request. Roles live in the database. The UI hides controls by role, and the API enforces them.
The role with the fewest permissions. Can view runs, but cannot start them, make approval decisions or administer the system.
Can start runs and trigger faults.
In the app, the fault switch is on the admin Rehearsal page; operators switch faults from the command line.
Can approve action plans. Can also verify, deprecate, re-verify or clear taint on knowledge.
Everything above, plus user management and the environment reset.
User management is built. The environment reset is on the admin Rehearsal page and is also a command-line target.
Only Google sign-ins with a verified email are accepted. Email-link sign-in for guests without Google accounts is deferred.
APPROVALS
Approval applies only to the exact proposal reviewed. If the proposal changes, the approval no longer applies. How the gate sits in the graph is on the Agent workflow page.
Built
Built
THE WRITE SERVICE
GitHub and shop writes happen outside the process that talks to models. The AI-facing API holds no write credential for GitHub or the shop.
action-runner holds the GitHub App key and the mitigation client, and makes every write. Cloud Run IAM lets only triage-api and the operator call it, and it checks the caller's email per route.
Each service has its own database role. triage-api cannot write action-runner's write_operations table, and action-runner can only read approvals and runs.
Models get four read-only tools. They propose catalog actions with bounded parameters and find-and-replace edits to allowed files; code checks both before the gate and again before writing.
The app opens pull requests but never merges them.
The limit: triage-api still writes approval rows, so a compromised triage-api could forge an approval. The boundary is that it holds no write credential, and action-runner checks the stored approval against the exact proposal.
AUDIT AND REDACTION
Every run leaves a trail. We describe the log as append-only for the application, and we claim nothing stronger.
An administrator can still disable the trigger. Successful writes are recorded in action-runner's own table, not as audit rows. Each run's Audit tab shows a span timeline; its staging proof is pending.
Fixed text patterns remove secrets and personal data. The API applies them to incident text, operator notes and decision comments before any of it reaches ADK. The run's stored events are redacted too.
Four secret types were planted for testing. None appeared in stored run data or model requests:
Not scanned: the budget ledger and ADK's other tables. Only these four types were planted. A provider error containing password=... is also stored redacted; one pattern was tested.
Every fetched log line, code file and commit is redacted before it is trimmed and before any model sees it. With that in place, prompt and response content is logged to BigQuery on staging.
Prompt-injection screening of the same tool output is a separate control; see the OWASP table below.
BUDGETS
Every model call reserves from the run's budget before it is sent, and that includes retries and fallbacks. If the run cannot afford the call, it is refused and the run ends budget_stopped with no model call.
Spend caps remain in place when a run pauses and resumes. Cloud Billing budgets provide backup alerts only.
Each attempt's cost is estimated from a versioned price table and stored, so a run's spend is measured. On staging, each run's summed cost matched its budget ledger. It is an estimate, not the provider's invoice.
OWASP AGENTIC TOP 10
How the controls above map to the OWASP Top 10 for Agentic Applications 2026. Addressed means the main routes into this app are covered and tested; anything listed as still open is bounded by another control. Partly means a known route stays open that no control bounds, and the last column says which.
| Risk | Coverage | How Beagle addresses it | Still open |
|---|---|---|---|
| ASI01 Agent Goal Hijack | Partly | Tool output and incident text are screened for injection, and flagged items are labelled as data. A proposal that cites flagged evidence as support fails validation. The graph is fixed, and a person approves every action.Details
| Screening uses five regular expressions (text patterns); paraphrased instructions get past them. Specialists' findings are not screened again. |
| ASI02 Tool Misuse and Exploitation | Addressed | Models get four read-only tools with validated arguments. Mitigations are catalog actions with bounded parameters. Every model attempt reserves budget first.Details
| Specialists are told their call limits in prompts. Deadlines and budgets constrain their calls. |
| ASI03 Identity and Privilege Abuse | Partly | Only action-runner holds GitHub and shop write credentials, and each service has its own database role. People sign in and hold roles. Approvals are bound to the exact proposal and re-checked.Details
| Agents share triage-api's identity. The person who started a run can also approve it. |
| ASI04 Agentic Supply Chain Vulnerabilities | Partly | Dependencies install from hash-locked lockfiles. No tools or MCP servers are loaded at runtime. The model registry is checked at startup, and knowledge files are admitted one by one.Details
| No dependency or secret scanning in CI, and no SBOM. Actions and the base image are not pinned by digest. |
| ASI05 Unexpected Code Execution (RCE) | Partly | Models have no code-execution tool in Beagle. They propose bounded find-and-replace edits to allowed files, and changes ship as pull requests that the app never merges.Details
| Model-written code runs in the storefront's pull-request CI before anyone reviews it; that CI's isolation is not assessed here. |
| ASI06 Memory and Context Poisoning | Addressed | Knowledge is screened on load. Search returns only stable, untainted documents: bundle documents are reviewed in Git, and a run's postmortem is searchable only after an approver verifies it. Each run pins its index version.Details
| The same regex screen as ASI01. |
| ASI07 Insecure Inter-Agent Communication | Partly | All agents run in one process and one fixed graph. Every call between services carries a Google ID token checked per route, and GitHub webhooks are signed.Details
| Specialists pass findings to the synthesizer as free text, with no required structure or second screening. An instruction in a finding could influence the proposal. |
| ASI08 Cascading Failures | Addressed | Atomic budgets, an attempt cap, per-specialist deadlines and at most one revision round. An executor that lost its lease cannot finish or pause the run.Details
| Spend is capped per run, not per day; Cloud Billing budgets only alert. |
| ASI09 Human-Agent Trust Exploitation | Partly | The gate shows the checked proposal: its checks, cited evidence, diff, critic objections, confidence and any flags. Citations must be evidence issued to the run. Approvals expire.Details
| Checks show a proposal is well formed and cited, not that it is right. No separation of duties. |
| ASI10 Rogue Agents | Partly | No agent is long-lived or self-starting; every run is bounded. The audit log is append-only for the application. Golden evals test the controls.Details
| A run in progress cannot be cancelled. There are no alerts on agent behaviour. |
Checked against the code on 2026-10-06. No third-party governance toolkit is used.
NEXT
The architecture alternatives page sets three Google Cloud paths side by side: ADK on Agent Runtime, ADK on Cloud Run and LangGraph on Cloud Run. Each cell explains who handles a production requirement and links to its source.
Next: Why ADK on Cloud Run →