Skip to content

feat(sidecar): add signed Go 1.27 policy decision service - #25

Open
usernamenenad wants to merge 1 commit into
aegisora-ai:mainfrom
usernamenenad:feat/go-sidecar-scaffold
Open

feat(sidecar): add signed Go 1.27 policy decision service#25
usernamenenad wants to merge 1 commit into
aegisora-ai:mainfrom
usernamenenad:feat/go-sidecar-scaffold

Conversation

@usernamenenad

@usernamenenad usernamenenad commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Introduce the first Go 1.27 decision-sidecar vertical slice for the Aegisora v1alpha1 governance contract, rebased onto the latest upstream main after Aegisora 2.0.0 and its delegation/collaboration hardening.

This PR intentionally establishes a decision service before the controlled-proxy boundary. It validates execution intents, verifies and atomically activates signed policy snapshots, evaluates deterministic ALLOW / BLOCK / ESCALATE outcomes, records correlated audit events, and exposes policy-backed readiness.

The upstream v1alpha1 OpenAPI contract and semantic fixture corpus remain unchanged, so the sidecar is contract-compatible. The documentation now also accounts for the canonical ToolRegistry, scoped single-use authorization receipts, correlation integrity, delegated-agent capabilities, scope containment, and collaboration ownership boundaries in the current runtime.

What changed

  • add the Go 1.27 sidecar service, Docker build, Makefile, local signing tools, examples, and documentation;
  • implement strict v1alpha1 domain validation and load the repository's shared semantic fixtures in Go tests;
  • implement Ed25519 policy signing and verification, canonical SHA-256 digests, expiry checks, scope checks, immutable snapshots, and atomic activation;
  • implement a deliberately small deny-overrides policy dialect (BLOCK > ESCALATE > ALLOW);
  • add bounded request idempotency with conflicting-payload rejection and concurrency-safe same-ID serialization;
  • bind cached decisions to the active policy version and digest so policy replacement, removal, or expiry forces reevaluation;
  • deep-copy cached risk signals and in-memory audit payloads so callers cannot mutate stored decisions or evidence;
  • add strict JSON, body-size, content-type, header-timeout, and total request-read-timeout handling;
  • add health, readiness, and active-policy metadata endpoints;
  • add Go 1.27 CI and release verification;
  • make the security-readiness workflow release-independent by deriving the expected public-package version from the canonical package manifest and scanning only Git-tracked repository content;
  • update the repository investigation and architecture proposal for the current 2.0 runtime authority, delegation, and collaboration model.

Security behavior

  • no valid unexpired policy means not-ready and fail-closed decisions;
  • unsigned, modified, expired, or incorrectly scoped bundles cannot activate;
  • allowed is mechanically derived from decision == ALLOW;
  • duplicate request IDs replay only for identical intent payloads under the same active policy version and digest;
  • policy changes invalidate compatible cache entries, preventing a stale cached ALLOW from surviving loss of authorization;
  • a request-ID payload conflict returns BLOCK;
  • broad allow rules cannot override a matching block rule;
  • audit append failure prevents a successful decision response;
  • bounded reads protect the local HTTP surface from oversized and indefinitely slow request bodies.

Verification

  • make fmt-check vet test-race build tools
  • npx --yes pnpm@11.20.0 verify
  • all 85 TypeScript runtime tests pass, including delegation, expiry, revocation, scope-containment, sibling-isolation, collaboration-ownership, governance-boundary, and correlation-integrity traces
  • git diff --check

Deliberate follow-up PRs

This PR does not claim a complete production enforcement boundary. The documented next slices are:

  1. controlled upstream proxying with strict signed route selection and zero-side-effect adversarial tests;
  2. authenticated workload identity over a Unix-domain-socket/local transport;
  3. FastAPI policy polling, rollback protection, key rotation, and last-known-good persistence;
  4. durable audit WAL/export and escalation approval flow;
  5. TypeScript distributed mode with no ungoverned fallback.

@usernamenenad
usernamenenad force-pushed the feat/go-sidecar-scaffold branch from 21ee3bc to 89fb25e Compare September 2, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant