feat(kit): central tools for harnesses through the egress proxy and gateway task-tool RPCs

This commit is contained in:
sam committed 2026-10-17 23:42:37 +11:00
1 parent f975dccec0
commit 3f553bb6f2
41 files changed
+2187 -189

No files matched your search

+44 -10
View File
@@ -40,8 +40,9 @@ Archie is a partial Kit runtime. It implements these capability types:
| `volume@1` | A Docker volume keyed by WorkflowExecution, deleted with it. |
| `lifecycle@1` | Install and startup hooks run on container create. |
| `agent-sessions@1` | The headless `prompt` and `resume` invocations for the stage. |
| `agent-skills@1` | The operator's skills store (`skills_dir`), mounted read-only whatever the Kit asks. |
| `agent-context@1` | The workload's profile file beside the workspace, indexing each Kit's guidance. |
| `agent-skills@1` | Discovery paths for bundled skills and optional shared skills; host access is always read-only. |
| `agent-skill@1` | Selected image-bundled skills copied into the declared discovery paths. |
| `agent-context@1` | The resolved discovery directory, defaulting beside the workspace; preserve instructions outside Archie-managed sections. |
| `resources@1` | Container CPU and memory limits. |
Every other type fails closed: a required entry refuses the launch, an
@@ -258,8 +259,8 @@ carries.
- **Proxy.** The proxy runs inside `archied`, listening on the host gateway
of the host-reachable network. It terminates TLS with a per-daemon CA
installed into the container at create, identifies the container by a
per-run proxy token, and applies that run's network policy and credential
inject rules. Upstream dials refuse loopback, and refuse internal addresses
per-run proxy password distinct from the worker's run grant, and applies
that run's network policy and credential inject rules. Upstream dials refuse loopback, and refuse internal addresses
unless the policy names the exact IP, so an allowed name cannot resolve
back into the host.
@@ -294,12 +295,34 @@ the run and not with how many agents it fans out to.
## Archie tools inside the harness
Capture tools, which are how a stage returns structured results, are served
by `archie-agent mcp`, a stdio MCP server registered through the Kit's MCP
configuration or the adapter's flags. It serves the stage's `CaptureTools`
and the central tools the agent profile's `AllowTools` permits, never the
`workspace` toolset. The runner's `ToolLimits` bound its results; the
harness's own built-in tools are outside archie's limits.
Capture tools return a stage's structured results through `archie-agent mcp`,
a stdio MCP server. The same command forwards central-tool discovery and
calls over Streamable HTTP to `http://archie.tools/mcp` through the egress
proxy. Claude Code, Codex, Pi, OMP and GitHub Copilot CLI register it using
their native MCP configuration. Registration files are per-stage and outside
the worktree; the Kit's bundled settings remain intact. A CLI that exits
without initializing the required MCP server fails the stage.
`archied` handles that exact endpoint inside the authenticated task proxy;
it is not a listener or an upstream network destination. It is available
only during task runtime, never during install or a setup session. The
harness supplies a sentinel, and the proxy injects a separate random gateway
token held only on the host. Ending the proxy session revokes that token and
cancels active calls.
The proxy reaches `archie-gateway` through its authenticated gRPC contract.
The Gateway derives the task, execution principal and org from a live run
grant on every request. Its tool list is bounded by the profile in that org
and the package's accepted tool authority, checked again at invocation.
Workspace tools, chat file delivery, conversation-only tools and tools that
require an unavailable approver are not served. Tool result limits apply
without exposing host spill paths; media is returned as MCP content.
Task MCP providers run in the Gateway with task-bound sessions and sampling.
Sampling uses the task's model and credentials, records task usage and refuses
revoked grants. It does not use the chat identity or chat model. The worker
does not start another copy of those providers for Kit tasks. The harness's
own built-in tools remain outside Archie's tool-result limits.
## Enforcement around the harness
@@ -360,6 +383,17 @@ of them.
## Verification
- Every named adapter discovers and calls a permitted central tool through
the proxy and records a local capture. A guessed tool outside the profile
or accepted package authority is refused.
- The gateway token never appears in the container, generated MCP files,
worktree, logs or events. It is not the container's proxy password.
- A permission change after discovery takes effect at the next call; ending
the proxy session cancels active calls, and a revoked grant cannot execute
tools or sample a model.
- Bundled skills remain visible with shared skills missing or disabled;
shared mounts are per-skill and read-only. Explicit context directories
preserve non-managed instructions and refuse symlinked staging paths.
- The same workflow definition completes on `builtin` and on the Claude Code
Kit with the same `Result` shape and captures.
- After `/login` in the setup terminal, the container's credential file holds