Skip to content

Propose that code runs in agentctl, not in the platform - #185

Open
nlundee wants to merge 1 commit into
mainfrom
docs/genki-agentctl-boundary
Open

nlundee wants to merge 1 commit into
mainfrom
docs/genki-agentctl-boundary

Conversation

@nlundee

@nlundee nlundee commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

What and why

Proposes ADR 0043: the platform never runs code that a model, a user or a tenant writes. When a service needs code to run, it calls an agent in agentctl, which already gives each agent an isolated computer with mediated network and no real secrets inside.

  • The platform does not run code. No interpreter, shell, child_process, vm or worker_threads in the API, the worker or the packages. A new dependency rule, no-code-execution-in-the-platform in .dependency-cruiser.cjs, enforces it outside test files. Nothing imports them today.
  • A service that needs code calls an agent in agentctl through the routes ADR 0028 already has: as a registered tool (MCP, OpenAPI or A2A, granted in spec.tools) or as a remote-agent. Everything ADR 0015 and 0028 keep at the boundary applies unchanged: the grant, the egress guard, secrets bound to the agent's host, untrusted results, timeouts, cost and audit.
  • An agent in agentctl uses the platform like any client: the open API, MCP or /v1 with a tenant key, which can only ask questions. Changes to services go through proposals that a person approves (ADR 0020, 0026).
  • Turned down: a sandbox inside the platform (as in ADR 0028), running every platform session inside agentctl (the platform's tool calls are HTTP through the egress guard, so a VM per session would add cost without isolating more), and moving datasets, rights or evaluation into agentctl.
  • Not built: no agent in agentctl is reachable as an MCP, A2A or remote-agent/v1 endpoint yet, and agentd would need to run on a host a tenant can register.

The number is 0043 because 0041 and 0042 are taken by #179 and #125.

How it was tested

  • npm run boundaries passes with the new rule (1,647 modules). With a temporary import { execSync } from 'node:child_process' in packages/kernel/src, it fails with no-code-execution-in-the-platform.

  • npm run check: 460 test files pass and 1 is skipped (4,906 tests pass, 12 skipped).

  • npx prettier --check docs/adr .dependency-cruiser.cjs.

  • npm run check passes

Checklist

  • Every new rule has a test whose name states it
  • User-facing text is in the i18n catalogues, in bokmål and English, with no em-dashes
  • Vendor SDKs stay in packages/providers-*
  • ADRs, docs and docs/architecture/modules are updated if a contract, boundary or module changed
  • No secrets, personal data or local paths

ADR 0043: the platform never runs code a model, user or tenant writes. A
service that needs code calls an agent in agentctl through the routes of
ADR 0028, and agents in agentctl use services through the open API with a
tenant key. A dependency rule forbids child_process, vm and worker_threads
in the API, the worker and the packages.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant