Agentic Covenants

Respond (RS) · Blast radius

Blast radius at the client side layer

deterministic · Outside the model's reasoning

How do I stop the bleeding now?

What this cell does

kill -KILL the agent process tree, tear down sandbox, optionally network-isolate operator host, docker stop or kubectl delete pod.

Artifacts (1)

agent-isolate-hostview on GitHub
#!/usr/bin/env bash
# ABOUTME: Local blast-radius containment runbook. Process-group kill of the agent tree, sandbox teardown, container stop.
# ABOUTME: Pre-authorized at on-call. Highest-urgency runbook in the matrix; speed target 5 seconds.

set -euo pipefail

if [[ $# -lt 1 ]]; then
  echo "Usage: agent-isolate-host <AGENT_NAME>" >&2
  exit 64
fi

AGENT_NAME="$1"
INCIDENT_ID="$(uuidgen 2>/dev/null || python3 -c 'import uuid; print(uuid.uuid4())')"
NETWORK_ISOLATE="${NETWORK_ISOLATE:-0}"   # set to 1 for last-resort host-side network cut

# 1. Kill the agent process tree by process group. -f matches the full
# command line so wrapped invocations are caught.
mapfile -t AGENT_PIDS < <(pgrep -f "claude.*$AGENT_NAME" 2>/dev/null || true)
for pid in "${AGENT_PIDS[@]}"; do
  PGID="$(ps -o pgid= -p "$pid" 2>/dev/null | tr -d ' ')"
  if [[ -n "$PGID" ]]; then
    kill -KILL -- "-$PGID" 2>/dev/null || true
  fi
done
sleep 1

# 2. Tear down sandbox. bubblewrap should exit when its parent dies if
# --die-with-parent was set; if it survives, kill explicitly.
pkill -KILL -f "bwrap.*$AGENT_NAME" 2>/dev/null || true

# 3. Containerized agents (Docker).
if command -v docker >/dev/null 2>&1; then
  mapfile -t DOCKER_IDS < <(docker ps --filter "label=agent=$AGENT_NAME" -q 2>/dev/null || true)
  if [[ ${#DOCKER_IDS[@]} -gt 0 ]]; then
    docker stop -t 0 "${DOCKER_IDS[@]}" 2>/dev/null || true
  fi
fi

# 4. Containerized agents (Kubernetes).
if command -v kubectl >/dev/null 2>&1; then
  kubectl delete pods -n "agent-$AGENT_NAME" --all --force --grace-period=0 2>/dev/null &
fi

# 5. Last-resort host network isolation. Only fire if NETWORK_ISOLATE=1.
# This also cuts off the operator's ability to ship more interventions.
# Only use if you have an out-of-band channel (phone, separate device).
if [[ "$NETWORK_ISOLATE" == "1" ]]; then
  echo "WARN: severing host network at operator request" >&2
  if command -v nmcli >/dev/null 2>&1; then
    ACTIVE=$(nmcli -t -f NAME connection show --active 2>/dev/null | head -1)
    [[ -n "$ACTIVE" ]] && nmcli connection down "$ACTIVE" 2>/dev/null || true
  fi
fi

wait

logger -t agent-incident -p user.warning \
  "$(jq -n \
      --arg event "blast_radius_contained_local" \
      --arg agent "$AGENT_NAME" \
      --arg incident "$INCIDENT_ID" \
      --arg actor "$(whoami)" \
      --arg ts "$(date -Iseconds)" \
      '{event:$event, agent:$agent, incident:$incident, actor:$actor, ts:$ts}')"

echo "Local blast radius contained for $AGENT_NAME (incident $INCIDENT_ID)"

Cell notes

Interventions, Blast radius / Client-side

Trigger. Falco alert from operator host, network attempt from --network none agent, sandbox boundary EPERM spike, unsandboxed-child detection.

Authority. On-call, no second approval. Highest urgency.

Speed target. Under 5 seconds.

Tooling

  • - pkill, pgrep, ps for process-tree kill.
  • - Optionally nmcli, ip link for last-resort host network isolation.
  • - docker and kubectl for containerized agents.

Files in this directory

  • - agent-isolate-host, runbook script. Process-group kill of the agent tree, kills bubblewrap parents, optionally severs host network, stops Docker/Kubernetes containers labeled with the agent.

Verification


# 1. No agent processes
pgrep -f "claude.*claude-code-prod"
# expected: no output

# 2. No sandbox processes
pgrep -f "bwrap.*claude-code-prod"
# expected: no output

# 3. Containerized agents stopped
docker ps --filter "label=agent=claude-code-prod"
# expected: empty list

Common mistakes

  • - pkill -f matches partial commands; if the agent is invoked through a wrapper, the wrapper survives. The runbook uses process-group kill (kill -- -PGID) to take the whole tree.
  • - Sandbox --die-with-parent flag was not set at launch. The sandbox does not exit when its parent dies. Verify Covenants L2-C3 launch flags.
  • - Network isolation cuts off the operator's ability to remediate. Use only as last resort, and have an out-of-band channel (phone, separate device) to maintain command.
  • - Forgetting the containerized-agent step, operator host is clean but Kubernetes pods keep running.

Citation

NIST CSF 2.0 RS.MI-01, RS.MI-02. NIST SP 800-160 Vol. 1. OWASP ASI05, ASI08. NIST AI RMF MANAGE 4.1.

Primary failure modes

Documented, not hypothetical. A control whose bypass is undocumented is worse than no control, because somebody trusted it.

  • pkill -f matches partials; wrapper survives
  • sandbox without --die-with-parent leaves children
  • network isolation also cuts off remediation channel

Crosswalk

NIST CSF 2 0RS.MI-01, RS.MI-02
NIST AI RMFMANAGE 4.1
OWASP AGENTICASI05, ASI08
OTHERNIST SP 800-160 Vol. 1