Audit this repo for release risks offline; generate a report
Add A3S Codeto an existing product
A3S Code provides agent sessions, tool execution, approvals, event streaming, and task recovery. Run a3s code directly or embed the Rust, Node.js, Python, or Go SDK.
curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/A3S-Lab/a3s/main/install.sh | sha3s codeType a message · / for commands · Shift+Tab cycles mode · Ctrl+C twice to exit
Review complete. Three subagents finished in parallel; the report artifact is ready to open in RemoteUI.
- ✔
Read repo constraints and release config
- ✔
Check code, tests, and docs in parallel
- ✔
Publish report artifact and open RemoteUI
Check arguments, permissions, and approvals before execution
Model tool calls do not go straight to the filesystem or shell. The runtime completes its checks first, then sends execution events and results to the application.
Check files, shell, Git, and external requests
After the model submits tool arguments, the runtime checks the arguments, workspace capability, and permission policy. Calls that need approval pause before execution.
Store large output as artifacts
File, search, command, and web results support ranges or cursors. Oversized output is written to an artifact; the model receives a preview, size, hash, and retrieval URI.
Render the AgentEvent stream
Text, tool calls, plans, approvals, and lifecycle changes have explicit event types. A terminal, IDE, or web app can consume the same stream.
Resume from SessionSnapshotV1
Sessions, runs, artifacts, traces, verification results, and child-task records are committed as one snapshot generation and loaded directly on resume.
Follow one complete run in Python
The example uses the actual a3s_code API in this repository. Scroll or select a step to add the Session, context limits, policy, event stream, and persistence.
Read the architecture guidefrom contextlib import closingfrom pathlib import Pathfrom a3s_code import Agentworkspace = str(Path.cwd())with closing(Agent.create("agent.acl")) as agent:pass
from contextlib import closingfrom pathlib import Pathfrom a3s_code import Agent, LocalWorkspaceBackend, SessionOptionsworkspace = str(Path.cwd())options = SessionOptions()options.planning_mode = "disabled"options.workspace_backend = LocalWorkspaceBackend(workspace)with closing(Agent.create("agent.acl")) as agent:with closing(agent.session(workspace, options)) as session:pass
from contextlib import closingfrom pathlib import Pathfrom a3s_code import Agent, LocalWorkspaceBackend, SessionOptionsworkspace = str(Path.cwd())options = SessionOptions()options.planning_mode = "disabled"options.auto_compact = Trueoptions.auto_compact_threshold = 0.8options.max_context_tokens = 128_000options.workspace_backend = LocalWorkspaceBackend(workspace)with closing(Agent.create("agent.acl")) as agent:with closing(agent.session(workspace, options)) as session:pass
from contextlib import closingfrom pathlib import Pathfrom a3s_code import (Agent,LocalWorkspaceBackend,PermissionPolicy,SessionOptions,)workspace = str(Path.cwd())options = SessionOptions()options.planning_mode = "disabled"options.auto_compact = Trueoptions.auto_compact_threshold = 0.8options.max_context_tokens = 128_000options.permission_policy = PermissionPolicy(allow=["read*", "ls*", "glob*", "grep*", "code_*"],deny=["write*", "edit*", "patch*", "bash*", "git*"],default_decision="deny",)options.workspace_backend = LocalWorkspaceBackend(workspace)with closing(Agent.create("agent.acl")) as agent:with closing(agent.session(workspace, options)) as session:pass
from contextlib import closingfrom pathlib import Pathfrom a3s_code import (Agent,EventType,LocalWorkspaceBackend,PermissionPolicy,SessionOptions,)workspace = str(Path.cwd())options = SessionOptions()options.planning_mode = "disabled"options.auto_compact = Trueoptions.auto_compact_threshold = 0.8options.max_context_tokens = 128_000options.permission_policy = PermissionPolicy(allow=["read*", "ls*", "glob*", "grep*", "code_*"],deny=["write*", "edit*", "patch*", "bash*", "git*"],default_decision="deny",)options.workspace_backend = LocalWorkspaceBackend(workspace)with closing(Agent.create("agent.acl")) as agent:with closing(agent.session(workspace, options)) as session:for event in session.stream("Find the authentication entry points. Do not change files."):if event.type == EventType.TEXT_DELTA and event.text:print(event.text, end="", flush=True)elif event.type == EventType.TOOL_START:print(f"\n→ {event.tool_name or 'tool'}")elif event.type == EventType.ERROR:raise RuntimeError(event.error or "A3S Code run failed")
from contextlib import closingfrom pathlib import Pathfrom a3s_code import (Agent,EventType,FileSessionStore,LocalWorkspaceBackend,PermissionPolicy,SessionOptions,)workspace = str(Path.cwd())options = SessionOptions()options.planning_mode = "disabled"options.auto_compact = Trueoptions.auto_compact_threshold = 0.8options.max_context_tokens = 128_000options.permission_policy = PermissionPolicy(allow=["read*", "ls*", "glob*", "grep*", "code_*"],deny=["write*", "edit*", "patch*", "bash*", "git*"],default_decision="deny",)options.workspace_backend = LocalWorkspaceBackend(workspace)options.session_store = FileSessionStore(".a3s/sessions")with closing(Agent.create("agent.acl")) as agent:with closing(agent.session(workspace, options)) as session:for event in session.stream("Find the authentication entry points. Do not change files."):if event.type == EventType.TEXT_DELTA and event.text:print(event.text, end="", flush=True)elif event.type == EventType.TOOL_START:print(f"\n→ {event.tool_name or 'tool'}")elif event.type == EventType.ERROR:raise RuntimeError(event.error or "A3S Code run failed")runs = session.runs()if runs:current = runs[-1]print(f"\nrun={current['id']} status={current['status']}")session.save()
Five parts of the runtime
Tools, models, run data, extension interfaces, and workspaces are configured separately. An application can enable only the parts it needs.
Workspace and policy determine the tool list
Files, search, shell, Git, web, batch, QuickJS, structured output, and child tasks are exposed only when the current workspace supports them and policy allows them.
Change the model adapter, not the Session API
Use Anthropic, Zhipu, OpenAI-compatible APIs, or inject your own LlmClient.
Runs, events, and snapshots use stable formats
A task can save snapshots, events, traces, artifacts, verification results, and checkpoints for queries, audit, or recovery.
Extend tools, context, and storage
Replace or extend MCP, Skills, ContextProvider, MemoryStore, SessionStore, workspace services, and custom tools.
Local, S3, and remote workspaces declare capabilities
Code navigation and file tools come from the workspace you select. If a remote or object-backed workspace cannot run local commands, Bash and Git are not shown to the model.
Run the CLI or use one of four SDKs
Use the terminal app directly in a repository. Use the Rust crate, Node.js package, Python package, or Go module in an IDE, runner, server, or custom interface.
a3s code
A ready-to-run terminal UI for reasoning, tool calls, approval prompts, task progress, and diffs.
a3s codea3s-code-core
The complete async runtime API, plus public traits for custom integrations.
cargo add a3s-code-core@a3s-lab/code
Native N-API bindings for sessions, event streams, tools, storage, orchestration, and MCP.
npm install @a3s-lab/codea3s-code
A native PyO3 package with both synchronous and asynchronous APIs.
python -m pip install a3s-codesdk/go/v6
A pure-Go API for sessions, event streams, tools, verification, and MCP through a long-lived bridge, without CGO.
go get github.com/A3S-Lab/Code/sdk/go/v6The runtime executes; the app owns accounts and access
- A3S Code Core provides the agent runtime. It is not a hosted service and does not dictate your UI.
- The a3s code terminal interface comes from the separate A3S CLI.
- Accounts, credentials, deployment, and direct access to application tools remain under your control.
Start with a read-only task
Install a3s code and run one inspection in an existing repository. Choose the Rust, Node.js, Python, or Go SDK when you are ready to embed it.