# Evolution 85 — Kill Switch Architecture

**FIRME AI CORPORATION · CAIN-42 · Evolution 85** — branch `evolution-85`, baseline Evolution 84 (`2c419a042`). Development result. Not deployed. Not released. Built by the three-person team.

## Scopes

GLOBAL, ORG, TENANT, SWARM, MISSION, AGENT, TOOL, CAPABILITY, RESOURCE, DELEGATION. Each scope blocks its own target
and nothing else (ten parametrised tests).

## Design

- **Durable state.** One SQLite file. Engage and reinstate are single IMMEDIATE transactions that increment a
  monotonic epoch.
- **Authenticated control.** A control message needs an Ed25519 signature from an operator key pinned when the switch
  was created, and an unused nonce. Unpinned keys, edited messages and replays are refused.
- **Fencing epochs.** Every single-use grant is bound, by the authorizer's signature, to the kill epoch it was issued
  under. The enforcement point refuses a grant issued before the last change that touches its context
  (`STALE_GRANT_EPOCH`), so a cached grant, a retry or a delayed message stays dead even after a reinstate.
- **Three checkpoints.** The decision, the enforcement point and the resource process each check the switch.
- **Fail closed.** Unreadable state denies everything.
- **Evidence.** Every state change is a hash-chained event carrying the operator's signed control message. Every
  refusal is a signed denial.

## Measured

| Measurement | Result |
|---|---|
| Engage transaction (same process, 200 trials) | p50 0.545 ms, p95 0.839 ms |
| Denial after engage (same process) | p50 0.511 ms, p95 0.982 ms |
| Slowest worker stop across processes | 5373.96 ms from the kill request, at up to 500 workers |
| Latest in-flight commit after the engage transaction | 5215.49 ms |
| Tasks done by agents revoked before start | 0 |
| Adversarial scenarios | 33/33 refused |

## Tested conditions

Stale grant after shutdown and after reinstate; grant replay; expired grant (delayed message); forged epoch binding;
restarted worker process; resource process killed mid-action; transport to the remote resource cut (labelled
SIMULATED_PARTITION); control replay and forgery; unreadable kill state.

## In-flight external effects

An action already past the resource's check when the switch engages completes; that window was measured at
5215.49 ms in the worst stage. Its receipt records the kill epoch at
issue. A lost acknowledgement is retried with the same idempotency key and produces one effect. Effects on systems
that offer no idempotency key or read-back cannot be reconciled and are outside what is claimed.

## Limits

One host or a shared filesystem: this is not a network protocol, and propagation across a partition was not measured.
A host that cannot read the state denies. The kill switch is not attached at the remote resource (the enforcement
point stops the call first). A same-user process outside a sandbox can write the resource file directly; that is
detected by the seal audit, not prevented.
