OpenProgram Docs

Unified agent action lifecycle

DimensionValuesMeaning
Permissionallow / ask / denyWhether this exact operation may begin under current authority
Outcomenot_started / succeeded / failed / unknownWhat is known about execution. A failure can have partial effects.
Deliverypending / recorded / projectedWhether the result is durably stored and reflected in conversation and UI
prepare → authorize → [durable wait → revalidate] → dispatch → record result → checkpoint → project
                  ↘ deny → record not_started → checkpoint → model continues or explains blocker

Built on the existing Agent loop, permission service, execution store, durable waits and interface projections; no second workflow engine. Action ID, execution ID, tool-call ID, policy version and canonical argument digest bind every decision, approval, receipt and recovery. A rejection is a completed decision with outcome not_started, not a completed task. Only unknown needs effect reconciliation.

Permission preparation and automatic review

  1. Resolve authenticated authority, policy version, tool capabilities, project binding and exact arguments; existing hard constraints, authority checks, plan restrictions, deny and ask rules and scoped grants stay.
  2. Preflight runs asynchronously before a dispatch intent. Auto review gets the complete bounded operation, trusted working directory and scope, the owner request and restrictions. Tool arguments and repository content are untrusted. Oversized or unparseable input is never approved from a truncated prefix.
  3. Classifier timeout, cancellation and provider failure differ from a risk rejection: they never execute the action and count as no verdict.
  4. A durable approval wait is published only for an eligible interactive owner. Hard constraints and explicit denials cannot become prompts. Noninteractive runs report the restriction and may continue independent work.
  5. Before dispatch, revalidate permission version, argument digest, approval identity and file preconditions. A mode change invalidates an obsolete decision; a grant never authorizes a modified command.
Limits on decisions
  • Auto review cannot rewrite its own policy. Changes to tools, permission state, project binding or restrictions invalidate cached decisions; there is no global allow cache.
  • Not every denial is not_started: a denial before the executor proves non-execution, but a rejected escalation after a sandbox attempt may follow partial execution and keeps that evidence.

Failure handling

FailureResponse
Invalid argumentsStructured validation details; the model may correct execution-relevant arguments
Permission rejectionRecord not_started with reason, policy version and allowed resolution. No retry under unchanged authority by altering descriptive text.
Transient transport failureBounded retry only with evidence of no execution or supported idempotency; never replay a possibly completed write
Deterministic tool failureOutput returned for diagnosis; repeats need changed input or conditions; other work may continue
Unknown side effectExact evidence preserved; reconciliation required, and a retry does not count as one
Infrastructure or checkpoint failureReported independently of the tool outcome; a recoverable receipt is kept when available
Repeat tracking and refusal counters
ItemRule
Recent failure mapBounded to the 16 entries AgentCheckpointV1 enforces, shared by loop and serializer. Eviction bounds storage, not permission or execution budgets. Full history stays in events; no failure count declares a task complete.
IdentityTool-specific: excludes presentation-only fields such as Bash description, keeps command, working directory and permissions. Fields named description on other tools are kept. Shell programs are never inferred equivalent. Legacy checkpoints stay readable; old keys are normalized only where the tool contract is known.
Fallback thresholdsThree consecutive or twenty total classifier refusals trigger manual prompting, through the existing owner approval wait; never overrides explicit denial
ScopeSession and owner policy version; a permission version change starts a new epoch
ResetsAllowed and approved fallback operations reset only the consecutive count; the total resets when its threshold approval completes or the epoch changes
No double countingCanonical execution events keep each operation identity and verdict in the existing SQLite transaction
No verdictChanges neither counter and never authorizes execution; risk refusals do not consume the execution-failure repeat budget

Receipts and recovery

A durable receipt holds exact tool-call identity, outcome, execution-start evidence, error code, result reference and digest, stored independently of display state. Checkpoint construction cannot erase a known result. External operations and local SQLite cannot share a transaction, so exactly-once external effects are not promised.

Found on recoveryAction
Receipt recorded, checkpoint missingRebuild the continuation from the recorded result
Checkpoint recorded, projection missingReplay projection only
Dispatch without a trustworthy receiptExisting effect reconciliation
Older recordsNon-execution is never inferred from tool text; reconcile the trusted permission event, call identity and stored command. A task is never marked completed as a repair.

Host integration

ItemRule
Execution startRecorded immediately before the authorized implementation
ResultsCompleted and not-started results are sealed before checkpoint serialization; application result details are not execution evidence
Tool visibilityModel-facing tools are filtered against live rules per provider request, without changing the saved execution contract; dynamic revocation is enforced at execution
ProjectionHost outcomes reach live events and history
Human UI actionsKeep their authenticated human origin; routing an agent action through HTTP grants no human privileges

Provider response events

Each dispatched model request has a unique request_id and exactly one started and one completed event. Completion records completed, failed, cancelled or incomplete, including transport exceptions and EOF without a terminal event. Exceptions and cancellation propagate unchanged; accounting does not replay tools or authorize retries. Legacy partial text stays incomplete, and observers do not treat unsuccessful requests as answers.

Ownership

AreaResponsibility
permissionsPolicy, asynchronous preflight, trusted review input, refusal counters, durable approval waits
agent tool executionRepeat tracking and identity in a small failure-policy module; consumes decisions, emits outcomes
conversation/production_driver and executionReceipts, checkpoint cursor, recovery, effect reconciliation
Web execution projectionWaiting, denied, failed, unknown and remaining work, on existing approval UI and actions
Native tools, Terminal, Web resources, application providersUse this lifecycle through the common tool entry; no provider-specific engines
Acceptance
AreaMust hold
Failure trackingMore than sixteen distinct failures cause no schema error; descriptive changes do not bypass suppression; changed executable arguments stay distinct; old checkpoints load
PreflightA denied operation never calls its executor; dangerous suffixes are caught; cancellation and policy changes do not dispatch; exact approvals survive restart once
Refusal fallbackInteractive and noninteractive differ explicitly; hard denials stay; counters survive resume and parallel calls
ReceiptsA failure between result and checkpoint, then restart, does not call a mutating executor again; unknown effects stay blocked
VisibilityRevocation is immediate; a hidden tool cannot be invoked by an old decision; UI and backend show the same reason and recovery actions
References
ReferenceBehaviourAdopted as
Codex ToolOrchestratorApproval precedes sandbox selection and execution; rejection differs from sandbox denial; escalated retries depend on policyOne pre-execution decision and typed outcomes; a retry never changes authority implicitly
Claude Code auto modeClassifier denials are visible; 3 consecutive or 20 total trigger prompting where supported; noninteractive runs keep the denialSeparate counters on durable approval waits; fallback thresholds, not task or storage limits
Claude Code permission rulesHarness-enforced; whole-tool denial removes the tool, scoped denial applies to matching operationsTool visibility reflects capability
Claude Code checkpointsFile-edit rewind does not undo Bash or external effectsConversation recovery, file undo and effect reconciliation stay distinct

The receipt protocol is an OpenProgram design, not a claim about other systems' internals.

Last updated · 2026-11-25