polytropos · guardrails · safety · security hardening

Guardrails, safety and hardening in polytropos

polytropos dispatches coding agents, runs the checks a kit names, and writes execution state. Running a kit's checks is intentional code execution, so its safety comes from naming exactly what is confined, what is gated, what is only recorded, and what is not a boundary at all. This page lists every guardrail, how each one is built, the test that proves it, and the stages where it acts. SECURITY.md is the policy; this page maps it.

Part 1

The posture

Three ideas hold the rest together: the approval line follows reversibility, the tool is for repositories you control, and only one thing runs inside an OS boundary.

Where the approval line sits

The line between what runs unasked and what waits for you is reversibility, not task size. Each lane is a code path, not a policy a model is asked to follow.

Reversible work

Runs without asking

Reading, planning, checking and rehearsing. Every demo, --demo and --dry-run path is synthetic or spawns nothing; harness_update.py check and preflight, exec_policy.py check and the docs generators' check compare and write nothing.

Consequential actions

Prepared, then gated on one named switch

Spending needs --live with --max-usd. Writing a harness home goes only through harness_select.py install or harness_update.py apply, and overwriting what it does not own takes --adopt-existing. Leaving the OS boundary is --exec-mode trusted-host; restoring a reviewer's blanket grant is --review-permissions bypass. Each opt-out reports itself.

Irreversible actions

Never on the engine's own initiative

Nothing relocates a store. The one deletion, runtime_data.py forget, is a dry run unless given --apply. Installation never overwrites what it does not own, and harness_update.py apply prints the ~/.claude remedy rather than running it.

Who it is for

polytropos is appropriate for repositories you control, run by the person who owns the machine. It is not an isolation boundary for unattended execution against untrusted repositories from a credential-rich host.

An outer sandbox — a container, a VM, a separate user account — is what limits host exposure today. polytropos does not provide one, and a kit is trusted input: its verify commands are code.

The execution boundary

During a headless kit run, only the verify command runs inside the OS boundary. The model dispatch runs with your privileges, because the sandbox blocks the Keychain where subscription credentials live.

Scroll sideways to see the whole diagram.

YOUR MACHINE · YOUR USER'S PRIVILEGES OS BOUNDARY · SANDBOX-EXEC Kit driver bin/claude_execute.py and siblings Verify command the task's own check writes: the workspace and a run scratch dir network: denied credential stores: unreadable environment: an allowlist no backend: refuses, never falls back Model dispatch claude, copilot, codex, agent not confined Workspace tree code, TASKS.md, NOTES.md the tree a worker edits Attempt ledger and stores outside the tree, 0700 / 0600 out of a confined check's reach Network Credential stores Keychain, provider keys runs the check itself the brief only; its provider's keys only edits reads and writes records every dispatch, before and after denied unreadable
A headless kit driver's run on macOS. The dashed red box is unconfined; the tinted box is the sandbox; a crossed line is a reach the sandbox denies. In the interactive loop the orchestrator runs each check through the session's own shell instead (Part 4).

How to read the controls

Each control in Part 2 says what it stops, how it works, the code that implements it, the test classes that prove it, and the stages where it acts. Where a search of the suite found no test, the card says No test found. A red note marks a limit of the control itself.

Part 2

Every control, and how it is implemented

Grouped by layer. The letter and number identify a control everywhere on this page.

A · Standing rules, enforced by tests

Rules that hold for every change, written once and backed by tests that fail when one is broken.

A1Invariants that fail the suite

Stopsa rule that lives only in prose and quietly erodes

CLAUDE.md lists the always-on invariants, and many of them are backed by tests that fail when one is broken. Each kit's GUARDRAILS.md adds fences for that change only.

CodeCLAUDE.md, .claude/kits/<slug>/GUARDRAILS.md

Proved bytests/test_privacy_layout.py PrivacyLayoutTests; tests/test_pricing_refs.py LiveTreeMirrorTests; tests/test_kit_contract.py TripleImplementationTests

Not every invariant has a test; each card below names the tests behind its own rule.

A2One kit contract

Stopsdrivers drifting apart in how they parse, validate and count a kit

Task parsing, graph validation, readiness, status transitions, budget admission, run ids and the outcome vocabulary are defined once and re-exported by every driver.

Codebin/kit_contract.py

Proved bytests/test_kit_contract.py TripleImplementationTests

A3A stdlib-only runtime

Stopsa third-party package entering the code that runs on your machine

bin/ and tests/ import only the Python standard library. The docs site's toolchain is the one exception, and it is hash-locked (I2).

Codebin/, tests/

Proved bytests/test_primitives_adversarial.py EngineHardConstraints

Only some modules carry their own stdlib-only check; no test scans the whole tree.

A4One pricing file per harness

Stopsa price, ratio or model id typed into a skill and going stale

Prices live only in data/pricing.json and one sibling file per harness. The mirrors under the skills are generated by bin/sync_pricing_refs.py, never hand-edited.

Codedata/pricing.json, bin/sync_pricing_refs.py

Proved bytests/test_pricing_refs.py LiveTreeMirrorTests; tests/test_docs_skill_dispositions.py NoNewLiteralsTests

The literal ban covers a named set of skill files, not every skill.

A5Generated documentation is never hand-edited

Stopsdocumentation that claims what its source no longer says

bin/docs_build.py, bin/copilot_docs.py and bin/release_gate.py build write their outputs, and each has a check that fails on drift.

Codebin/docs_build.py, bin/copilot_docs.py, bin/release_gate.py

Proved bytests/test_release_gate.py ReleaseDocTests

A6Tests never call a real model CLI

Stopsa test spending real credits or touching your live harness homes

Every dispatcher takes an injectable runner, tests use stubs and temporary homes, and --dry-run and --demo spawn nothing. No module in bin/ starts a process except through bin/proc_runner.py.

Coderun_task(…, runner, verify_runner) in each driver, NO_REAL_CLI_TESTS in bin/release_gate.py

Proved bytests/test_proc_runner_wiring.py OneRunnerTests

Nothing scans the tests for a real-CLI call; that part is a convention.

B · Spec and plan gates

What the architect writes into a kit, and the rules the run must honor because the kit says so.

B1The approval pause

Stopsa plan built on a spec nobody agreed to

The architect shows the spec draft and writes nothing to disk until you approve it.

Codeskills/architect/SKILL.md, Step 1

Proved bytests/test_architect_approval_pause.py ArchitectApprovalPauseTests

B2Kit fences, re-read at every phase start

Stopsconstraints that a long run or a compaction quietly dropped

PLAN.md's out-of-scope section and the kit's GUARDRAILS.md bind every task. The execute loop re-reads both from disk before the first task of every phase.

Codeskills/execute/SKILL.md

Proved byNo test found.

No test pins the re-read, and a compaction mid-phase is caught only at the next phase start.

B3The red-green evidence rule

Stopsa check that proves nothing because it passed before the work began

Before a task's work starts, its check runs on the pre-task tree. A pass there is a tautological-verify defect and blocks the task. Tasks marked regression or precondition are expected to pass first.

Coderun_precheck in bin/kit_verify_hook.py, reconcile_task in bin/kit_contract.py

Proved bytests/test_kit_verify_hook.py PrecheckTautologicalTests; tests/test_claude_execute.py EndToEndTautologicalVerifyTests

B4The budget dial

Stopsa run dispatching past what the plan allows

PLAN.md's optional budget: line caps dispatches, escalations, consults and model calls. Usage is recounted from what is already recorded, and a reached cap stops the run without marking the task. A budget stop never overwrites a real verdict.

Codebudget_gate and parse_plan_budget in bin/kit_contract.py

Proved bytests/test_claude_execute.py EndToEndPlanBudgetStopTests; tests/test_routing_scorecard.py BudgetStopNeverSupersedesVerdictTests

B5Declared roles run, or the run stops

Stopsa review step the kit asked for being skipped in silence

roles: and workflow: are parsed by one grammar. A role a driver cannot sequence stops the run unless --roster-gap disclose prints the gap and records it in the attempt ledger.

CodeROLE_CONTRACTS and ROLE_SUPPORT in bin/kit_contract.py

Proved bytests/test_role_contract.py RosterCheckTests, SupportTests

B6Re-routing is upgrade-only and advisory by default

Stopsa run quietly moving work to a weaker model

A recommendation only ever moves a tier up. In the default advisory mode it is printed and recorded, and nothing changes until a person decides.

Codeskills/execute/references/rerouting.md, bin/routing_scorecard.py

Proved bytests/test_reroute_live.py UpgradeDecisionTests, ParseAutonomyTests

B7Routing policy is selected, never learned

Stopsobservations or model output changing which policy routes a task

A Codex task's policy comes only from a --policy flag or PLAN.md's routing: line. Hard filters (availability, an explicit pin, an exclusion, effort support, the budget) apply before any preference is weighed.

Codebin/routing_policy.py

Proved bytests/test_routing_policy.py FiltersTests

C · Checks before anything runs

The kit is checked before the first dispatch, without executing anything it contains.

C1The task graph is validated first

Stopsa plan with a cycle, a duplicate id or a missing dependency running partway

kit_contract.py graph names every such defect with its fix and exits 2. A driver dispatches nothing on an invalid graph.

Codevalidate_graph in bin/kit_contract.py

Proved bytests/test_kit_graph.py ValidateGraphTests, ZeroDispatchOnInvalidGraphTests

Stages7 Analyze

C2analyze is static by construction

Stopsa pre-run check that itself executes the kit's commands

kit_contract.py analyze checks the paths each brief names and whether each verify command can be resolved. It has no runner, so it cannot execute anything.

Codeanalyze_kit in bin/kit_contract.py

Proved bytests/test_kit_analyze.py StaticByConstructionTests

Stages7 Analyze

C3The spec review before dispatch

Stopscontradictory acceptance or an uncovered goal reaching the implementers

In an interactive run, one opus reviewer reads the kit before the first dispatch and reports contradictions and goals no task covers.

Codeskills/execute/references/spec-review.md

Proved bytests/test_execute_preflight.py PreDispatchStepTests, SpecReviewReferenceTests

Interactive only: headless drivers and workflow: direct kits print the analyze warnings, and nothing judges them.

Stages7 Analyze

D · The execution boundary

How processes, paths, credentials and dispatches are confined or recorded while a kit runs.

D1Verify commands run inside an OS sandbox

Stopsa check writing outside the workspace, reaching the network or reading credentials

On macOS the kit drivers run each check under sandbox-exec: writes only to the workspace and a run scratch directory, network denied, credential stores unreadable, and the environment reduced to an allowlist. It refuses rather than falling back when no backend exists, and --exec-mode trusted-host is the named opt-out that reports itself.

Coderun_confined, verify_runner, _CONFIDENTIAL_HOME_PATHS and DEFAULT_ENV_ALLOWLIST in bin/exec_policy.py

Proved bytests/test_exec_policy.py FailClosedTests, EnforcementTests, ProfileRenderingTests; tests/test_proc_runner_wiring.py DriverVerifyWiringTests

The enforcement tests run only where a sandbox is available. Linux and Windows have no backend.

D2Every external process is bounded

Stopsa hung or noisy process, or children that outlive the run

Each process gets a validated working directory, a wall-clock limit, an output ceiling that keeps draining, and a session of its own, so ending it ends its whole process group.

Coderun, validate_workdir and _terminate_tree in bin/proc_runner.py

Proved bytests/test_proc_runner.py WorkdirTests, TimeoutAndTreeCleanupTests, OutputBoundTests

D3A dispatch carries only its provider's credentials

Stopsone provider's agent receiving another provider's keys

The environment handed to a harness CLI is a base set plus that provider's own variables.

Codedispatch_env and PROVIDER_ENV_PREFIXES in bin/proc_runner.py

Proved bytests/test_proc_runner.py DispatchEnvironmentTests; tests/test_proc_runner_wiring.py DriverDispatchTests

D4Paths are contained without a race

Stopsa symlink swapped in mid-operation redirecting a write

Every store, marker and install destination is reached directory-relative with O_NOFOLLOW. Where the runtime lacks directory-relative operations, it refuses instead of using the racy form.

Code_descend and _require_dir_fd in bin/safe_paths.py

Proved bytests/test_safe_paths.py ContainmentTests

The refusal on a host without directory-relative operations has no test.

D5Every dispatch is recorded before and after

Stopsa crash losing track of what ran, or a dead attempt counted as a success

An append-only ledger outside the tree. An attempt with no result is closed as unknown, never as success, and never replayed; a task is claimed with O_EXCL; prior attempts count against the budget. A logged-out CLI or a missing binary stops the run instead of escalating.

Codeclaim, record_started and reconcile_open in bin/attempt_ledger.py

Proved bytests/test_attempt_ledger.py LedgerRecordTests, ClaimTests, CrashAfterDispatchTests, BudgetCarriesAcrossRunsTests

D6Codex review and acceptance are read-only

Stopsa reviewer changing the code it is reviewing

bin/codex_execute.py forces --sandbox read-only on review and acceptance, and refuses extra arguments that would override it or displace the selected model.

Codecmd_review and cmd_accept in bin/codex_execute.py

Proved bytests/test_codex_execute.py EndToEndRunHappyPathTests

The review path is tested; acceptance and the override refusal have no test.

D7Cursor is identified before it is trusted

Stopsdispatching to some other binary that happens to be named agent

--version or about --format json must identify Cursor before any claim, ledger entry or write. Review runs under --mode ask, and arguments that would change the mode, model, workspace or session are refused.

Coderequire_cursor, READ_ONLY_MODE and BLOCKED_EXTRA_ARGS in bin/cursor_adapter.py

Proved bytests/test_cursor_adapter.py IdentityTests, DispatchArgvTests; tests/test_cursor_execute.py IdentityRefusalTests

D8Reviewers get no blanket permission grant

Stopsa review dispatch running with every tool pre-approved

Review carries no blanket grant by default. Claude turns the reviewer's declared tool pin into --allowedTools, and --review-permissions bypass is the named opt-out.

Coderole_permission_profile and allowed_tools_arg in bin/claude_execute.py

Proved bytests/test_claude_execute.py RolePermissionTests; tests/test_copilot_execute.py ReviewPermissionTests

A pin that includes Bash still reaches everything a shell reaches (see Part 4).

D9Concurrent work cannot collide silently

Stopstwo workers' writes merging into a broken tree

Sequential by default. With --max-parallel, each task runs in its own copy outside the workspace, writes are measured rather than declared, a conflicting write applies nothing from that task, a worker that edits the kit is recorded as a violation, and the merged tree is verified again.

CodeDEFAULT_MAX_PARALLEL and snapshot_tree in bin/kit_scheduler.py

Proved bytests/test_kit_scheduler.py SequentialDefaultTests, ConflictTests, MergedTreeTests, SecurityTests

D10A code graph is read as untrusted evidence

Stopsa crafted graph steering reads outside the repository or walking without bound

A graph's source_file must be relative and traversal-free; the graph has a byte ceiling; walks and searches are bounded; git is reached only with read-only verbs.

CodeMAX_GRAPH_BYTES in bin/graph_ground.py

Proved bytests/test_graph_ground.py StampTests, FreshnessTests, ImpactTests

E · Independent verification

Who decides a task is done. The builder never does.

E1The loop runs the check, not the builder

Stopsan implementer grading its own work

The orchestrator runs each task's verify command itself. An implementer's claim of success is not evidence. A failure gets one retry with the failure output, then a frontier consult.

Codeskills/execute/SKILL.md, the loop

Proved byNo test found.

This is a rule in the skill text the orchestrator follows; no test found pins it.

E2A fresh-context verifier, and optional adversaries

Stopsreview that is anchored on the builder's view

A verifier with none of the builder's context re-checks acceptance against the files. A kit can add a test-author, who writes tests from the brief alone, and a red-team, who tries to break the result.

Codeskills/execute/SKILL.md, skills/execute/references/roster.md

Proved byNo test found.

The role vocabulary is tested (tests/test_role_contract.py), but no test found checks that the verifier is dispatched without the builder's context.

E3Phase review against the plan

Stopsa phase drifting from the plan before the next one starts

At each phase end an opus reviewer checks the phase against PLAN.md, and its findings are adjudicated and recorded before the run continues.

Codeskills/execute/SKILL.md, phase boundaries

Proved byNo test found.

This is a rule in the skill text the orchestrator follows; no test found pins it.

E4A rewritten brief is caught

Stopsa worker editing its own brief, check or dependencies to make a task pass

The task block is re-read at projection time. A change is reported and recorded as plan.drift, and the verdict stays the one for the plan the run started with.

Codeplan_drift in bin/kit_contract.py

Proved bytests/test_kit_graph.py PlanDriftTests

F · Honest records and claims

What the ledger, the release matrix and the cost figures may and may not say.

F1An acceptance is bound to its own run

Stopsbackfilling acceptances for work that was finished long ago

kit_contract.py accept refuses unless the task's latest passing outcome line carries the same run= id it was given, dated today or yesterday in UTC.

Codeaccept_task in bin/kit_contract.py

Proved bytests/test_kit_evidence.py AcceptRunGuardTests

F2drift reports, and writes nothing in the tree

Stopsa later re-check silently failing or rewriting finished work

kit_contract.py drift re-runs a finished kit's checks inside the execution boundary and reports drift, not failure. It writes nothing in the tree or the kit directory; its events go to the ledger outside the tree.

Codedrift_kit in bin/kit_contract.py

Proved bytests/test_kit_evidence.py DriftTests, DriftTestAuthorTests

The checks it runs may write, since the workspace is writable under the policy.

F3Release claims are computed, never typed

Stopsa release document claiming support the evidence does not show

The supported matrix in docs/RELEASE.md is rendered from the capability registry, the contract versions and the manifests. check fails on a drifted block, an unpinned workflow action, or a private store without its ignore rule.

Coderun_check and packaging_review in bin/release_gate.py

Proved bytests/test_release_gate.py PackagingTests, ReleaseDocTests

F4Unknown means no

Stopsa driver relying on a capability nobody has run

primitives/harness-capabilities.json records support, implementation and verification separately. A capability recorded as unknown counts as unsupported.

CodeUNKNOWN and supports in bin/harness_adapter.py

Proved bytests/test_kit_contract.py CapabilityRegistryTests

F5A subscription run is never shown as a bill

Stopsa ChatGPT-plan Codex run reported as dollars spent

Its dollar figure is a labelled relative-burn proxy: billed_usd stays null and the source stays unpriced, and proxy figures never enter a priced total.

Codeest_cost in bin/codex_pricing.py, bin/codex_usage.py

Proved bytests/test_codex_pricing.py BurnIndexTests; tests/test_journal_sources.py CodexAdapterTests

G · Data and privacy

Where personal data lives, what is read, and what reaches a model.

G1Stores live outside the tree, private

Stopspersonal data landing in a distributed, synced or committed tree

Every store resolves to a per-user application-data directory, namespaced per checkout, created 0700 with 0600 files. An existing in-tree store keeps being used, and migration copies without deleting the original. The ignore rules are root-anchored.

Coderesolve_store, ensure_private and migrate in bin/runtime_data.py

Proved bytests/test_privacy_primitives.py ResolutionTests, PrivateCreationTests, MigrationTests; tests/test_privacy_layout.py PrivacyLayoutTests

G2Harness homes are read read-only, from JSONL

Stopsa usage report writing into your harness home or opening its database

The usage, journal and context readers read ~/.claude, ~/.copilot and ~/.codex strictly read-only, and never open a SQLite file.

Codebin/copilot_usage.py, bin/codex_usage.py, bin/journal_sources.py

Proved bytests/test_copilot_usage.py ReadOnlyProofTests; tests/test_codex_usage.py ReadOnlyProofTests; tests/test_journal_sources.py CodexAdapterTests

These are behavior tests on fixtures; no test scans the readers' source.

G3Free text is redacted before it is kept or sent

Stopsa credential pasted into an inbox line reaching the digest or a model

Inbox lines pass through the redactor on the way into the journal and on the way to a model. What it caught is reported by kind and count, never by value.

Coderedact_all and describe in bin/redact.py

Proved bytests/test_journal_collect.py InboxRedactionTests; tests/test_privacy_primitives.py RedactionTests

Shape-matching only (see Part 4).

G4Memory recall is pulled, capped and labelled

Stopsa store being bulk-injected into a session, or a recalled fact read as an instruction

Recall returns a few relevant facts under a budget, with each one's source, scope and trust. A fact scoped to another project or provider is withheld.

Coderecall and apply_budget in bin/memory_recall.py

Proved bytests/test_memory_recall.py BudgetTests, ProvenanceAndScopeTests, GateTests

That recall is pull-only, never injected, has no test of its own.

G5The journal summary runs isolated

Stopsthe summarizing model reading the repo's instructions or writing files

The summary runs in an empty temporary directory with a reduced environment, and is rejected if anything was written there.

Codedefault_runner in bin/journal_summarize.py

Proved bytests/test_journal_summarize.py IsolatedSummaryDispatchTests

H · Install, update and release

How polytropos writes into a harness home, and how a release is cut.

H1Installation never overwrites what it does not own

Stopsan install replacing your own agent, skill or instructions file

Each destination is classified before a byte is written; creation uses O_EXCL; a managed refresh re-reads the file just before replacing it; rollback takes back only bytes this run wrote; --adopt-existing keeps the prior bytes.

Codeapply_copilot_plan and _rollback_written in bin/harness_select.py

Proved bytests/test_install_ownership.py CopilotRollbackTests, CopilotAdoptionTests, CodexStalePlanTests, SafeCreateTests

H2The freshness check only reads

Stopsa status check that changes what it reports on

harness_update.py check compares and writes nothing. apply writes only the Copilot and Codex homes and the repo's generated mirrors, never ~/.claude: that remedy is printed for you to run.

Codecmd_check in bin/harness_update.py

Proved bytests/test_harness_update.py ReadOnlyTests, ApplyNeverNamesTheClaudeHomeTests

H3The install preflight

Stopsinstalling from a dirty, unpushed or credential-bearing checkout

Eight gates: the source exists, the marketplace installs from it, git can read it, it is on main, clean, level with origin, carries nothing credential-shaped, and its version changed.

CodePREFLIGHT_GATES and run_preflight in bin/harness_update.py

Proved bytests/test_harness_update.py PreflightTests

H4The version bump touches only the version

Stopsa release step that edits or commits more than it says

release_gate.py bump edits only where the version is stated and what reports it, refuses while uncommitted work is present, and never commits.

Codebin/release_gate.py bump

Proved bytests/test_release_gate.py BumpPlanTests

I · Build supply chain

The one non-stdlib toolchain, the docs site, is pinned rather than trusted.

I1Actions are pinned to commit SHAs

Stopsa re-pointed or compromised tag changing what CI runs

Every GitHub Action is pinned to a full commit SHA, with its release in a trailing comment.

Code.github/workflows/docs-site.yml

Proved bytests/test_docs_site_workflow.py WorkflowBuildJobTests; tests/test_release_gate.py PackagingTests

I2The docs toolchain is hash-locked

Stopsa substituted package running inside the docs build

docs-src/requirements.txt pins every package, transitives included, with a sha256, and CI installs with --require-hashes.

Codedocs-src/requirements.txt

Proved bytests/test_docs_site_workflow.py WorkflowBuildJobTests

I3Deploy credentials live only in the deploy job

Stopsrepository content running with the right to publish

The build job holds contents: read only. pages: write and id-token: write exist only in the deploy job, which runs no repository code.

Code.github/workflows/docs-site.yml

Proved bytests/test_docs_site_workflow.py WorkflowDeployJobTests

I4Generated links are scheme-checked

Stopsan unsafe link hiding in generated documentation

Each URL's scheme is checked after rewriting against a small allowlist, and control characters are refused. An unsupported scheme fails the build.

CodeALLOWED_URL_SCHEMES and safe_href in bin/copilot_docs.py

Proved bytests/test_copilot_docs_content.py LinkSchemeTests

J · Spend and evaluation

What can spend money, and what can change a routing default.

J1Benchmark spending is ceiling-gated

Stopsa benchmark spending without a stated limit

No dispatch happens without --live and an explicit --max-usd, validated finite and non-negative on every check. plan and demo spend nothing.

Codevalidate_ceiling in bin/repo_bench.py

Proved bytests/test_repo_bench.py RunCliTests

J2Target repositories are read-only

Stopsa benchmark changing the repository it measures, or leaking the answer

A target is reached only through a read-only git verb allowlist. Sandboxes are history-free tree extractions, and reference tests are never written into a candidate's tree.

Codegit_target and READ_ONLY_GIT in bin/repo_bench.py

Proved bytests/test_repo_bench.py AllowlistTests, SandboxTests

J3A routing default changes only through review

Stopsone lucky run changing how every later task is routed

The policy file is written only by apply, which refuses a proposal below the evidence floor, from a single repeat, or without a named reviewer's acceptance. Every version is kept, and rollback restores one.

Codeapply_proposal and rollback_policy in bin/workflow_eval.py

Proved bytests/test_workflow_eval.py PolicyProcessTests

Part 3

Stage by stage

The stages are the ones on docs/sdd/pipelines.html, numbered the same, plus the three places polytropos acts outside a kit's lifecycle: installing and updating, releasing and building, and evaluating models.

The matrix

A dot means at least one control in that layer acts at that stage.

Each stage

The controls that act at each stage, linked to their cards in Part 2.

1 · Standing rules

  • A1 Invariants that fail the suite
  • A2 One kit contract
  • A3 A stdlib-only runtime
  • A4 One pricing file per harness
  • A5 Generated documentation is never hand-edited
  • A6 Tests never call a real model CLI
  • F4 Unknown means no

2 · Research

  • D2 Every external process is bounded
  • D10 A code graph is read as untrusted evidence
  • G4 Memory recall is pulled, capped and labelled

3 · Specify

  • B1 The approval pause
  • B2 Kit fences, re-read at every phase start

4 · Clarify

  • B1 The approval pause

5 · Plan

  • B2 Kit fences, re-read at every phase start
  • B4 The budget dial
  • B5 Declared roles run, or the run stops
  • B7 Routing policy is selected, never learned

6 · Tasks

  • A2 One kit contract
  • A4 One pricing file per harness
  • B3 The red-green evidence rule

7 · Analyze

  • A2 One kit contract
  • B5 Declared roles run, or the run stops
  • C1 The task graph is validated first
  • C2 analyze is static by construction
  • C3 The spec review before dispatch

8 · Implement

  • A2 One kit contract
  • B2 Kit fences, re-read at every phase start
  • B4 The budget dial
  • B5 Declared roles run, or the run stops
  • B6 Re-routing is upgrade-only and advisory by default
  • B7 Routing policy is selected, never learned
  • D1 Verify commands run inside an OS sandbox
  • D2 Every external process is bounded
  • D3 A dispatch carries only its provider's credentials
  • D4 Paths are contained without a race
  • D5 Every dispatch is recorded before and after
  • D7 Cursor is identified before it is trusted
  • D9 Concurrent work cannot collide silently
  • E1 The loop runs the check, not the builder
  • E4 A rewritten brief is caught
  • F4 Unknown means no

9 · Verify and converge

  • A6 Tests never call a real model CLI
  • B2 Kit fences, re-read at every phase start
  • B3 The red-green evidence rule
  • D1 Verify commands run inside an OS sandbox
  • D2 Every external process is bounded
  • D3 A dispatch carries only its provider's credentials
  • D5 Every dispatch is recorded before and after
  • D6 Codex review and acceptance are read-only
  • D7 Cursor is identified before it is trusted
  • D8 Reviewers get no blanket permission grant
  • D9 Concurrent work cannot collide silently
  • E1 The loop runs the check, not the builder
  • E2 A fresh-context verifier, and optional adversaries
  • E3 Phase review against the plan
  • E4 A rewritten brief is caught

10 · Feedback

  • A4 One pricing file per harness
  • D4 Paths are contained without a race
  • F1 An acceptance is bound to its own run
  • F5 A subscription run is never shown as a bill
  • G1 Stores live outside the tree, private
  • G2 Harness homes are read read-only, from JSONL
  • G3 Free text is redacted before it is kept or sent
  • G4 Memory recall is pulled, capped and labelled
  • G5 The journal summary runs isolated
  • J3 A routing default changes only through review

11 · Keep in sync

  • D1 Verify commands run inside an OS sandbox
  • D2 Every external process is bounded
  • F2 drift reports, and writes nothing in the tree

Install and update

  • D4 Paths are contained without a race
  • G1 Stores live outside the tree, private
  • H1 Installation never overwrites what it does not own
  • H2 The freshness check only reads
  • H3 The install preflight

Release and CI

  • A3 A stdlib-only runtime
  • A5 Generated documentation is never hand-edited
  • F3 Release claims are computed, never typed
  • F4 Unknown means no
  • H4 The version bump touches only the version
  • I1 Actions are pinned to commit SHAs
  • I2 The docs toolchain is hash-locked
  • I3 Deploy credentials live only in the deploy job
  • I4 Generated links are scheme-checked

Evaluation and benchmarks

  • D2 Every external process is bounded
  • J1 Benchmark spending is ceiling-gated
  • J2 Target repositories are read-only
  • J3 A routing default changes only through review

Part 4

What is not a boundary

Do not rely on any of these. Each is a known gap, stated so that the controls above are not read as stronger than they are.

Model dispatch is not confined

The macOS sandbox blocks the Keychain, where subscription credentials live, so a confined model CLI cannot log in. A dispatch runs with your privileges, your network and its provider's login.

The interactive loop's own checks are not sandboxed

exec_policy confines a check when a driver, the verify hook's precheck or drift runs it. In the interactive /polytropos:execute loop, the orchestrator runs each verify command through the session's own shell.

Linux and Windows have no sandbox backend

--exec-mode enforced refuses there, and only the explicit trusted-host mode runs. That is a stated gap, not a silent downgrade.

A worktree or a scheduler copy is not a sandbox

Separate directories separate files and writes. They do not separate privileges, credentials or network access, and a worker reading a file another is changing is not detected.

Benchmark candidates and judges are not yet confined

A protected-experiment profile exists in bin/exec_policy.py, but nothing dispatches through it yet; benchmark setup and test commands run with the driver's privileges.

Role names are not permissions

A prompt that says read-only does not make a reviewer read-only. A tool pin that includes Bash reaches everything a shell reaches, Copilot has no per-tool flag, and only Codex pins review to a read-only sandbox.

Execution state is not tamper-proof

TASKS.md, NOTES.md and the verify markers sit in the tree a worker edits. Edits are detected and reported, not prevented, and the ledger outside the tree is out of a confined check's reach but not an unconfined dispatch's.

A spend cap is not a provider cap

Budget dials and --max-usd stop polytropos from dispatching. They cannot stop a provider from billing, or undo spend already incurred.

A capability nobody has run is not a control

Most capability rows say unknown, and that is the honest state until someone runs them.

Redaction is shape-matching

It catches strings shaped like published credential formats. A password that reads as a word, a name or an address has no shape and is not caught.

Recording an attempt is not exactly-once execution

A process killed at its limit may already have been billed or written a file. The ledger closes it as unknown and never replays it; it cannot know what the provider billed.

An isolated summary is not proof the model had no tools

The journal summary is shown to have run outside the project and written nothing there. No tool-restricting flag is passed.

drift cannot yet tell a nested sandbox from real drift

A check that starts its own sandbox is refused inside drift's, and reads as drifted.

Kits are trusted input

A kit's verify commands are code. Running a kit you did not write is running its scripts.

Repository settings are not set by code

Dependabot, secret scanning and push protection are account switches; nothing here claims they are on.