Agency composes a coding agent from a harness, a model backend, a sandbox and a skill contract. The application describes the work in Python; Agency orders requests, runs the selected harness, routes its model and tool calls, and publishes the result with updated conversation and filesystem state.
The source package lives in agency/ at the repository root. These pages follow its directories and explain the responsibilities and connections implemented in the code.
| Source directory | Design responsibility |
|---|---|
agency/configs/ |
Configuration shared across components, with explicit namespaces and safe snapshots. |
agency/orchestrator/ |
Dependency ordering, execution admission, result settlement and shared resource allocation. |
agency/engine/ |
One request’s execution lifecycle and the host services used by its harness. |
agency/harness/ |
Sandbox daemon, CLI adapters, protocol translation and process supervision. |
agency/native_harness/ |
Agency’s own model-and-tool loop, packaged as a standalone CLI. |
agency/llm/ |
Provider selection and translation between Agency messages and provider protocols. |
agency/sandbox/ |
Runtime backends, filesystem access, resource limits and checkpoints. |
agency/observability/ |
Event storage, profiling, trajectory reconstruction and the Web UI. |
agency/host/ |
Explicit machine provisioning and validated runtime profiles. |
agency/utils/ |
Python workflow helpers and shared runtime utilities. |
Nested directories are described on their parent package’s page. The modules directly under agency/ define the public objects that connect these packages.
An agent owns configuration, conversation context, logging and a sandbox reference. Its selected harness determines which coding-agent implementation runs. An agskill describes one piece of work: instructions, input/output schemas, tools and policy. Keeping the skill separate from the agent lets the same contract run through different harnesses.
agdata carries inputs and outputs, including pending results backed by Python futures. agcontext carries the latest transcript, per-harness session snapshots and retained messages. agschema and the agtype classes define field types and prepare or recover file-backed values across the sandbox boundary. agtool wraps a Python callable; agpolicy supplies tool and syscall hooks. agteam groups agents and a Python workflow.
These objects are implemented in agent.py, agskill.py, agdata.py, agcontext.py, agschema.py, agtype.py, agtool.py, agpolicy.py and agteam.py. The package exports bring them together for applications.
flowchart TB
subgraph host[Host Python process]
app[Application and public objects] --> orchestrator[orchestrator: order and admit]
orchestrator --> engine[engine: execute one request]
engine --> services[engine/host_servers: model, tools, policy]
services --> llm[llm: provider backend]
logs[observability: records and views]
orchestrator -. records .-> logs
services -. records .-> logs
end
subgraph runtime[Sandbox runtime]
daemon[harness: daemon and gateway] --> adapter[harness/adapters: selected harness]
adapter --> native[native_harness or external CLI]
end
engine -->|attempt and control RPC| daemon
daemon -->|model, tool and policy bridge| services
llm --> provider[Model service]
sandbox[sandbox: runtime and checkpoint lifecycle]
engine --> sandbox
sandbox --> runtime
The host owns scheduling, provider credentials and host Python tool closures. The sandbox owns the daemon and harness processes. Control and callback traffic use separate local socket connections; the sandbox gateway presents the HTTP and MCP interfaces the harness expects. This layout comes from engine execution, host service assembly and the harness daemon.
agent.run() submits a skill and returns a pending agdata. Submission registers the request and publishes a new context future together. Later work on that agent depends on this context; pending input values can introduce dependencies on other agents.The design keeps request ordering, execution and harness behavior in separate owners. It coordinates conversation and sandbox state within a live process. External mount writes, host-tool effects and model-service effects remain outside filesystem rollback. Adapter completion also does not establish task correctness; see harness completion and known contracts.
For callable signatures, use the API reference. For installation and configuration, use getting started and the guides.