Skip to content
Agentic Control Plane

The Prime Agent control model, explained

Prime Agent has no permission system. Anything its kernel can reach, it runs, with your full access. The only place to add control is an extension.

Prime Agent is a hard fork of pi. Where pi ships four tools, Prime Agent ships one: a persistent ipython kernel. Shell commands, file edits, Python and network access all run as code in that kernel.

Around the kernel sits the machinery for staying alive: daemon-backed sessions, heartbeats, schedules, recursive subagents (await rlm(...)), and a bounded /autonomous mode. It is built for long, unattended runs.

This page covers Prime Agent’s own model. To add ACP, see the install guide. For the cross-harness picture, see the controls comparison.

What Prime Agent ships

  • No permission prompts, no rules, no sandbox. The kernel runs with the launching user’s full access. The extension docs list “permission gates (confirm before rm -rf, sudo, etc.)” as the first example use for an extension.
  • Limits on how much, not on what. /autonomous takes maxTurns, maxContinuations, maxTokens and timeoutMs, and print mode reports which limit stopped the run. They cap the budget. They don’t say which actions are allowed.
  • A session tree, not an audit record. Like pi, sessions are JSONL files you can fork and rewind. That is the run’s own account, kept on the run’s own machine.
  • A resident daemon. A supervisor process hosts session workers over sockets in $TMPDIR/prime-agent-<uid>/, and sessions survive the TUI closing. Extensions load per worker (/reload picks up changes). A worker killed with kill -9 leaves a stale socket that hangs the next CLI start, so clear the socket directory when testing.

The extension seam: two events from pi

Prime Agent kept pi’s extension API, with the same package name and the same typed events:

Event Fires An extension can
tool_call before the tool runs return { block: true, reason } to deny, or change event.input in place to rewrite arguments (nothing re-validates them afterward)
tool_result after the tool runs return { content, details, isError } to rewrite or redact what the model reads

Handlers run in load order. There is no MCP layer and no second dispatch path, so these two events cover everything. Because the one tool is ipython, an extension sees code, not a parsed intent. That is coarse, but it is complete.

Extensions load from ~/.prime/agent/extensions/*.ts (global, no trust prompt, the right place for a control extension) or .prime/agent/extensions/ (project-local, behind project trust). TypeScript loads directly with no build step, and Node 22.8 or newer is required.

The provider seam, pi.registerProvider("anthropic", { baseUrl }), sends model traffic through a proxy in three lines. That is how cost gets metered.

The signal that lies: hasUI in print mode

In pi, ctx.hasUI tells an extension whether a person can answer. With nobody there, an approval can deny instead of hanging. Prime Agent kept the API but not the behavior: 0.8.x reports hasUI = true in headless -p print mode. The docs say print mode has a no-op UI, the type comments say false, and the runtime says true (checked against 0.8.1 with a live extension).

Checking argv doesn’t fix it either. Prime Agent runs every CLI session in a daemon worker (argv --mode daemon, env PRIME_AGENT_INTERNAL_DAEMON_WORKER=1). The worker’s argv never shows -p, and the same worker class hosts attached TUI sessions and headless print runs.

An extension that trusts hasUI treats unattended runs as attended. Outage handling then proceeds when it should block, and asks try to prompt a chair nobody is sitting in.

What does tell them apart is the confirm dialog itself. An attached client answers it. The headless no-op UI can’t say yes. So the working approach is to route asks through the confirm dialog and treat a no-op or false answer as deny. The ACP extension does this. A cleaner upstream fix would be per-session client-attachment state on ExtensionContext.

What Prime Agent leaves out

This is the same gap as pi, with higher stakes because the harness runs longer with less supervision.

  • No policy. Nothing decides allow or deny until an extension does.
  • No independent record. The session tree doesn’t show what was checked, against which policy, or on whose authority.
  • No identity. Kernel executions aren’t tied to a user or a chain of delegation, and subagents multiply that.
  • Limits are not controls. maxTokens stops a runaway bill. It doesn’t stop a dangerous action.

What the ACP extension adds

The ACP extension for Prime Agent is the same pattern as the pi extension: one dependency-free TypeScript file on tool_call and tool_result. It adds one thing for this fork, a fix for the hasUI bug.

Attendance is decided by three checks together: hasUI, argv, and a daemon-worker check. Where those can’t tell, the confirm prompt is the probe, so an empty chair denies instead of approving. Daemon-worker and headless sessions also get a conservative tier label by default.

On tool_call, workspace policy returns allow, ask or deny before the ipython kernel runs anything. On tool_result, output scanning can redact what the model reads back. Every decision (allow, ask, deny, redact) is recorded off the machine, whether or not a person was watching that worker.

If the gateway is unreachable, a session that is clearly attended proceeds with a loud UNGOVERNED warning. In a daemon worker, where attendance is ambiguous, the extension asks in the confirm dialog whether to proceed ungoverned. No answer from a headless no-op UI means the call is blocked, and so are unattended runs. Every lapse is logged to ~/.acp/lapse.log.

Configuration uses the same environment variables as the pi extension: ACP_BEARER_TOKEN (workspace key), ACP_GOVERN_BASE (gateway URL), ACP_AGENT_TIER (session label, defaulted conservatively for daemon workers), and ACP_SHADOW (record without enforcing, for testing against a live daemon before you turn policy on).

Cost is separate from tool-call policy. Pointing Prime Agent’s registerProvider seam at the ACP proxy gives you per-call cost, cache-hit rate and a workspace budget cap on daemon sessions that can otherwise run for hours unmetered. See Prime Agent cost tracking for the three-line setup.

Where ACP fits

Prime Agent is pi with the autonomy turned up. The core is minimal, control is an extension, and sessions outlive the terminal that started them.

The ACP extension is that control. Workspace policy decides allow, ask or deny on every tool_call, output scanning runs on tool_result, and every decision is recorded off the machine and joined across your fleet. The same policy applies to Claude Code, pi and dsh.

Frequently asked questions

Does Prime Agent have a permission system?

No. Prime Agent (PrimeIntellect-ai/prime-agent, a hard fork of pi-mono) ships one model-facing tool, a persistent ipython kernel, and no built-in approval prompts, allowlists, or sandbox. Its extension docs list the permission gate as the standard example extension: block-dangerous-commands is something you write, not something it ships.

Can a Prime Agent extension block or approve tool calls?

Yes. Prime Agent kept pi’s typed event pipeline. tool_call fires before execution and can return { block: true, reason } or change event.input in place. tool_result fires after and can rewrite content, details, or isError. Handlers run in load order. There is no MCP layer and no second dispatch path (MCP arrives as Python skills that run inside ipython), so an extension on these two events sees every call.

Can an extension tell when Prime Agent runs unattended?

Not from hasUI alone. ctx.hasUI is documented as false in print mode, but Prime Agent 0.8.x reports true there (checked against 0.8.1). Every CLI session, TUI and -p alike, also runs inside a daemon worker process (argv --mode daemon, env PRIME_AGENT_INTERNAL_DAEMON_WORKER=1), so hasUI can’t tell an attached client from none. What does work: the no-op UI in headless sessions can’t answer a confirm dialog, so a prompt is a reliable check for whether anyone is there. An ask that nobody can answer resolves to deny.

What does Prime Agent ship for autonomous runs?

Bounded autonomy. /autonomous mode takes explicit limits (maxTurns, maxContinuations, maxTokens, timeoutMs) and stops at them. Daemon-backed sessions survive restarts and support heartbeats and schedules. These limits cap how much the agent does. Nothing decides which actions are allowed, and the session tree is the run’s own account of itself, not an independent record.

Running coding agents? ACP records each tool call its hook sees and makes the dangerous shell commands (a force-push, destructive SQL, curl | sh) wait for you. One command, free up to 5 agents:

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  Getting started