Governed shell binary — human + machine modes (Rust)
Find a file
Tyler J King eab034f0cc feat: gsh machine mode — first governed shell execution
~200 lines of Rust. Every command: AC → exec → CR → CID.

Usage:
  gsh --exec "echo hello"
  gsh --exec "hcloud server list" --json
  gsh --exec "ansible-playbook site.yml" --dry-run

Flow:
  1. SHA-256 hash the command
  2. POST /governance/authorize/ → AC ID
  3. exec(sh, -c, command) → capture stdout/stderr/exit
  4. POST /governance/complete/ → receipt + Chronicle CID
  5. Print stdout (passthrough) or JSON (structured)
  6. Exit with command's exit code

Environment:
  GSAP_BROKER_URL   http://fastapi-gsap:8000
  GSAP_AGENT_DID    did:web:bxnet.../agent/platform-ops
  GSAP_TOKEN        Bearer token (optional)
  GSAP_CORPUS_CID   sha256:{image_digest} (optional)

Tested against live fastapi-gsap Spoke broker on Hetzner:
  dry-run: AC only ✓
  live exec: stdout passthrough + CID ✓
  JSON mode: ac_id + cr_id + chronicle_cid ✓
  exit code: 42 passed through ✓

The command_hash in the AC request means the broker knows
WHAT will be executed before authorizing. Not just "was
this agent allowed" but "was this exact command authorized."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 19:01:22 -04:00
src feat: gsh machine mode — first governed shell execution 2026-04-01 19:01:22 -04:00
.gitignore feat: gsh machine mode — first governed shell execution 2026-04-01 19:01:22 -04:00
Cargo.lock feat: gsh machine mode — first governed shell execution 2026-04-01 19:01:22 -04:00
Cargo.toml feat: gsh machine mode — first governed shell execution 2026-04-01 19:01:22 -04:00
DESIGN.md feat: gsh governed shell — design exploration 2026-03-30 23:20:27 -04:00
README.md Initial commit 2026-03-31 03:15:52 +00:00

gsh

gsh — the GCAP governed shell. Human and machine modes. Chronicle-attributed execution.