This release is a pre-release and may not be stable for production use.
Acuto
Agentic Contract-based runtime Orchestration: contract-based symbolic control of LLM agents.
Declare a procedure once, as contracts over the agent's tool calls. Acuto hides the tools the contracts rule out, executes the steps they determine without asking the model, and checks every call before it runs.
Acuto (Agentic Contract-based Runtime Orchestration) is a symbolic control layer for LLM agents. A library of assume-guarantee contracts in ALTLf over the tool-call trace compiles to deterministic automata whose joint state the framework walks as a residual policy graph: each node carries the tools the contracts still admit and, when only one remains, the call itself. Three mechanisms read that graph before every step. Masking exposes only the admissible tools. Fast-forward executes a step the contracts determine, or an obligation that has fallen due, with no model call. Verification checks every call before it executes, whether the model proposed it or the framework scheduled it, and every result before the model sees it. Acuto drives the agent loop itself, so the guarantee holds by construction: every executed action crosses the same boundary.
Installation
pip install acuto # Python 3.10+
pip installs the contragent runtime dependency automatically. To
work on Acuto itself, clone this repository and run:
pip install -e ".[dev]"
Quick start
An agent is a model, its tools, and a contract library. Tools say what the agent can do; contracts say what is allowed and required; Acuto drives the loop. Register tools as synchronous functions.
import acuto
agent = acuto.Agent(model=acuto.models.resolve("openai:gpt-5-mini"),
instructions="You are a bank service agent.")
@agent.tool
def verify_identity(user_id: str) -> dict:
"Verify the customer's identity."
return {"verified": True}
@agent.tool
def issue_refund(order_id: str, amount: float) -> dict:
"Issue a refund for an order."
return {"refunded": True}
agent.attach(acuto.ContractLibrary("refund-desk-v1", [
acuto.action("issue_refund").requires("identity_verified").at_most(1),
acuto.after("verify_identity").asserts("identity_verified",
when=lambda r: r.output["verified"]),
]))
agent.run("Refund order #123 for customer u1", verbose=True)
Until the identity is verified the model does not see issue_refund; a
premature refund is refused with the recovery step named; a second
refund is refused outright. A contract is a rule about the trace, a
fact is what a tool result established, and an obligation
(acuto.when(fact).obligates(tool)) is a duty a fact creates, which
Acuto discharges itself when its arguments are determined. verbose=True
prints every decision as it happens.
The model key is read from the environment (OPENAI_API_KEY,
ANTHROPIC_API_KEY, GEMINI_API_KEY, or the AWS pair), then from a
.env in the working directory. examples/ runs the same
programs with a scripted model and no credentials:
quickstart.py is the program above,
bank_demo.py shows an obligation being
fast-forwarded and a forbidden call refused, and
embed_controller.py drives Acuto from
a loop of its own.
Use your own model
Acuto talks to the provider with your key; there is no Acuto service in between and no provider SDK to install.
import acuto
acuto.models.resolve("anthropic:claude-sonnet-5-5") # ANTHROPIC_API_KEY
acuto.models.resolve("openai:gpt-5-mini") # OPENAI_API_KEY
acuto.models.resolve("gemini:gemini-2.5-flash") # GEMINI_API_KEY
acuto.models.resolve("bedrock:us.anthropic.claude-haiku-4-5-20251001-v1:0") # AWS keys
# any OpenAI-compatible endpoint: a hosted one, or vLLM / SGLang on your machine
acuto.models.resolve("openai:deepseek-chat",
base_url="https://api.deepseek.com/v1",
api_key_env="DEEPSEEK_API_KEY")
# local OpenAI-compatible server without authentication
acuto.models.resolve("openai:local-model", base_url="http://localhost:8000/v1")
For the default endpoints, credentials come from the environment variables
shown, then from a .env file in the working directory. For a custom
OpenAI-compatible endpoint, pass api_key= or api_key_env= if it requires
authentication. Acuto sends the request without an authorization header
when both are omitted. An explicit api_key= overrides the environment. For a model
behind your own API, write a class with one method,
generate(messages, tools, system), that returns a ModelTurn:
examples/custom_model.py.
Long runs
A long task outgrows the context window and outlives the process. The control state (monitors, facts, obligations) is kept apart from the messages, so both can be handled without changing what is allowed or required.
from acuto import Agent, Checkpoint, MaskCompactor
agent = Agent(model=model, compactor=MaskCompactor(threshold=100_000))
agent.run(task, checkpoint_path="run.json") # state written before every step
# after a crash or a kill: continue from the step that was cut off
agent.run(task, resume=Checkpoint.load("run.json"))
A compactor moves old tool results out of the model's view once the
context passes its threshold; the model reads them back with the
acuto_recall tool. A resumed run replays its journal into a fresh
controller, so no call that completed is made again. A call that was
sent when the run died, to a tool not marked idempotent, is not
repeated unless you pass on_in_flight="redo".
examples/long_run.py shows a run that dies and
is resumed; docs/LONG_RUNS.md has the design and
its guarantees.
Sub-agents
A parent agent can send sub-agents to do parts of a task at the same time. The developer defines the kinds of sub-agent (tools, model, step budget); the parent model decides when to spawn them and with which task. Each sub-agent runs under the parent's contracts on the tools it holds, and when all have ended, their calls are replayed into the parent's controller, so the parent's contracts count what they did.
spawner = acuto.Spawner(
[acuto.SubagentType("prices", "Reads daily closes", tools=["query_bars"], model=haiku)],
tools=data_registry,
)
lead = acuto.Agent(opus, contracts=desk_contracts)
lead.add_subagents(spawner) # the lead gets a spawn_subagents tool
The call blocks until every sub-agent has ended and returns one report
each: its status (completed, max_steps, dead_end, error), its
answer and its calls.
examples/research_subagents.py runs a
lead with two kinds of sub-agent; docs/SUBAGENTS.md
has the details and the limits.
Using Acuto from your own loop
acuto.Agent is a reference loop over acuto.Controller, one session of
control any loop can drive. route() masks the tools and says who acts
next; verify(call) is the boundary every call crosses; commit(call, result) verifies the result and advances the state; execute(call)
chains the three when Acuto runs the tools.
controller = acuto.Controller(library, tools=registry)
while True:
decision = controller.route()
if decision.kind is acuto.StepKind.SYMBOLIC_EXECUTE:
controller.execute(decision.action) # no model call
continue
turn = my_model(messages, tools=registry.schemas(decision.actions))
for call in turn.tool_calls:
outcome = controller.execute(call) # verify → run → commit
messages.append(tool_message(outcome.feedback()))
Documentation
- SDK reference: the public surface in three tiers, the contract DSL, where a contract library lives, flows, model adapters, and the extension points.
- Sub-agents: spawning sub-agents and how their contracts are handed down.
- Design covers the runtime architecture.
Citation
Cite the software using CITATION.cff.
License
Acuto is licensed under Apache-2.0. See CONTRIBUTING.md for the development workflow.
Metadata
Release files for acuto 0.2.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acuto-0.2.0a1.tar.gz | 95.4 kB | With provenance | Details for acuto-0.2.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acuto-0.2.0a1-py3-none-any.whl | Python 3 | none | any | Details for acuto-0.2.0a1-py3-none-any.whl |
Total release size: 202.4 kB
Release files / acuto-0.2.0a1.tar.gz
| Download URL | acuto-0.2.0a1.tar.gz |
|---|---|
| Size | 95.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a63d51b712f7d1b32c1381da1f49a6ec64330d10d2bafbc0d447ed268d611106
|
|
BLAKE2b-256 checksum How to use checksums |
a90ab91c0a30a6dbf7eeb5b69b56e0a14893f19a4326ce7113ab8a320bb604dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / acuto-0.2.0a1-py3-none-any.whl
| Download URL | acuto-0.2.0a1-py3-none-any.whl |
|---|---|
| Size | 107.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9ace57d3b314a0b638a97918ab0c9a3b237472f8812b9f56d643638a903f9e8
|
|
BLAKE2b-256 checksum How to use checksums |
3b0360bd27ef140ac4333800c3de0e367f10361b4503c7d092876cdb12d8fe86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for acuto 0.2.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for acuto-0.2.0a1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.