A Tour
The quickstart agent could answer and call a tool. This tour gives an agent what it needs before it is allowed to act: a policy that asks a person before a refund, a sandbox where its commands run, a budget checked before every model call — and the record of each.About fifteen minutes and a few cents of model usage. Part 2 needs Docker running
and
pip install "omnicoreagent[docker]". Every output shown is what the code
printed on one run. Yours will differ where the model decides: its wording,
the commands it chooses, and the tokens and cost. What the runtime does will
not: the run pauses at the refund, resumes after the approval, and stops
before the budget is spent.1. Ask a person before a refund
A policy decides, for every capability the agent has, whether to allow it, deny it, or ask a person. Start from a built-in profile and add one rule: refunds are asked about.The built-in profiles.
interactive-dev allows your local tools, the
workspace, memory, skills, code mode and sandboxed commands; it asks before
commands outside a sandbox, network access, package installs, MCP tools,
sub-agents and background runs; and it denies reading raw secrets.
permissive-dev, the default for an agent that sets nothing, allows
sub-agents, background runs and the MCP servers you configure outright, and
denies unsandboxed commands, host files, network access and package installs
instead of asking. strict-production allows nothing but its own telemetry without a rule
of yours. See the security model.- The run paused at the refund —
statusawaiting_approval— with the exact call it wanted to make. Nothing was refunded until someone decided. resolve_approvalrecorded who decided.decision="deny"with anotesends the model the reason instead;arguments={...}approves an edited call.resumecontinued the run where it stopped. It can happen minutes or days later, in another process, when the agent’s memory is a durable store — SQL, Redis or MongoDB — throughmemory_router. This example keeps it in memory, so here the run lives only as long as the process (durable runs).- A run can pause again after a resume — once for each call that needs a
person — so approve in a loop until the status is no longer
awaiting_approval. Asession_idis optional; the run makes one. - The story of the run has a segment for each stretch between pauses — here
two — and
story["tool_calls"]lists every call with how it finally ended. Each segment’s own trajectory has the details, including the policy decision behind every call.
2. Run commands in a sandbox
Turn on a sandbox provider and the agent gets anexecute tool. Its commands run
inside the sandbox, not on your machine, and the sandbox is not given your
process’s keys and tokens.
3. Put a price on it
A budget caps what a run, a session, an agent or the whole application may spend. Before each model call, the runtime prices the call — the input it counts, and the output atmodel_config["max_tokens"] — and holds that
amount. If the hold does not fit, the run waits for a person instead of
making the call. Without max_tokens, a budgeted call is priced at 4,096
output tokens and held to them: an answer that reaches the limit ends the run
with termination_reason length, so set max_tokens when answers are
long. A provider that counts input tokens differently can still settle a
little above the hold; the real cost is recorded either way. Here, a limit
far too small:
grant_budget is a
recorded, one-off exception with a name on it — the policy itself is unchanged —
and resume carried on. To end the run instead, deny_budget.
Without amount, a grant covers the shortfall of the one call that stopped:
the run can stop again at its next call. To give it headroom, grant more,
e.g. grant_budget(run_id, approver="alice", amount=0.50). A grant adds to
what the budget allows; budget_status(run_id) shows each budget’s limit,
what was granted, what is spent, and what remaining.
What you have now
An agent that can act, and a record that says what it did and why it was allowed to. From here:Policy reference
Profiles, rules, targets, and what every capability means.
Durable runs
Pauses, crashes and resumes; budgets in full.
Execution
The execute tool, the workspace bridge, sandboxes that die.
Every run is evidence
Trajectories, outcomes, training records, exporters.