Repository navigation
Conversation
compile-agent, teach over MCP and the airbag guard now pass the task's teach scope (inputs, origins and writes), so text on the page an agent reads can't widen what run 1 may type, reach or write. - compile-agent (FirstRunCompiler, compile_first_run, CLI): the scope is built from the app URL's origin, --expect, the inputs and --on-screen, plus --allow-origin, --allow-text and --write-adapter. A violation ends run 1 as scope_refused; a read-back that doesn't show the declared write ends it as readback_refused. The Claude and code-as-action agents no longer swallow a scope refusal. - Any violation during a JIT capture refuses the draft, even when the agent caught the refusal and went on. - Teach over MCP: a scope violation ends run 1 like a refused save. --teach-allow-origin and --teach-write-adapter set the scope; --teach-tasks takes run 1's record and inputs from operator task files, so the agent can't re-declare them after reading the app. - Airbag guard: with a scope, every request of the tab is paused; reads to undeclared origins (image beacons, links, scripts) are blocked, and with write_adapter each save is read before it is sent. guard.yaml gains allow_origins, allow_text and write_adapter. A run that left its scope is never handed to run 2. - teach_scope: TeachScope.for_task, request_refusal and claim_refusal for reuse, load_write_adapter, scopes with no browser origin. - tests/test_injection_paths.py runs the MockMed injection fixtures through each path with agents that obey them. THREAT_MODEL, LIMITS, GUARD_AN_AGENT, COMPILE_AGENT and the agent README describe the shipped behavior; the CAPABILITIES Limits line about unscoped paths is gone. All data is synthetic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1384 (which holds #1359, #1335 and #1357). Retarget to
mainonce #1384 merges; the diff here is only this change.What changes
Before this change, only
openadapt_flow.jit.compile_agentenforced the teach scope from #1359. compile-agent, teach over MCP and the airbag guard read the same untrusted app content without it. Now all three pass the task's declared inputs, origins and writes, and the MockMed injection fixtures run through each path.compile-agent (
FirstRunCompiler,compile_first_run,openadapt-flow compile-agent)--expect(the record), the inputs and--on-screen.--allow-origin,--allow-textand--write-adapter MODULE:ATTR.scope_refused. A read-back that doesn't show the declared write ends it asreadback_refused. Neither leaves a draft.JIT capture
Teach over MCP (
openadapt-agent serve --teach)--teach-allow-originand--teach-write-adapterset the scope.--teach-tasks DIRtakes run 1's record and inputs from the operator's task files (openadapt.guard-task/v1). A hijacked agent then can't re-declare another record after reading the app.Airbag guard (
openadapt-flow guard)write_adapter, each save is read against the task's record and values before it is sent.guard.yamlgainsallow_origins,allow_textandwrite_adapter.teach_scope
TeachScope.for_task, a purerequest_refusalandclaim_refusal(shared with the guard),load_write_adapter, and scopes with no browser origin (desktop surfaces).Docs
llms-full.txtis rebuilt.Tests (no model calls)
tests/test_injection_paths.py, 16 cases with agents scripted to obey the injected text:scope_refused), an outside origin (scope_refused, no request reaches it), skip the check against an app that writes nothing (readback_refused), and a clean run that is a draft.--teach-tasksrefusing a re-declared record.VERIFIED.tests/test_injection_suite.py: new case where an agent swallows a refusal and still gets no draft.tests/test_teach_scope.py: the builder, the request check and the adapter loader.tests/e2e/test_mcp_teach_e2e.py::test_a_save_on_the_wrong_record_fails_the_read_backnow expectsreadback_refused. The scope's read-back of run 1 refuses before the older record check runs. It is still refused with nothing to admit.Local runs:
packages/agent: 534 passed, 9 skipped.Still true after this
--teach-tasks, the agent declares the record atteach_start. The person who confirms the record check sees it.🤖 Generated with Claude Code