wardyn

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: Apache-2.0

README

Wardyn

Go 1.26 CI

The open-source governed-sandbox control plane for any workload — identity, controls, and audit are the product; the sandbox is a pluggable commodity. Anything you run under your own credentials inherits your full blast radius; Wardyn is the layer in between — per-run identity, credentials minted and revoked per run, one audited path off-host, no resident key. Coding agents are the flagship use.

Status: pre-alpha. Interfaces are not stable. Do not run production workloads. "Wardyn" is a working name — trademark clearance (USPTO full-text + org / domain / package handles) is still pending, so the name and the personal github.com/cjohnstoniv/wardyn module path may change before a 1.0.

Wardyn detecting this host's confinement capabilities

Quickstart

git clone https://github.com/cjohnstoniv/wardyn
cd wardyn
make setup   # containerized control plane + UI

make setup asks containerized vs host (Enter = containerized; WARDYN_SETUP_MODE=container|local skips it). Containerized keeps wardynd in a compose container, so sandbox callbacks route in-network and record/replay work on Docker Desktop + WSL2 NAT.

Give it a model — all first-class at the CLI or in the UI:

claude setup-token | wardyn subscription connect   # subscription (never resident)
echo "$KEY"        | wardyn secret set anthropic-api-key   # API key
# Bedrock: WARDYN_BEDROCK_REGION/MODEL (+ WARDYN_BEDROCK_AWS_DIR for ~/.aws SSO)
wardyn setup status   # what's configured + the next command per unmet check

One file, one command? Put the sandbox rules in a small YAML (or JSON) policy and hand it to one wardyn run — interactive or unattended:

wardyn run --agent claude-code --task-mode exec \
  --task 'echo hello from a governed sandbox' \
  --policy-file examples/policies/sandbox.yaml --wait

That file is a commented, sealed floor; wardyn policy render -f <file> checks it. --image brings your own base (docs/ENVBUILD.md); make compose-down stops everything.

Requirements
  • Docker + compose v2 (Postgres rides in the compose file). Fence/CC1 needs nothing more; Wall/CC2 adds gVisor's runsc, Vault/CC3 /dev/kvm + Kata — wardyn setup wall|vault prints the steps for your host.
  • Go 1.26+, Node 22 + pnpm 9 — only to build from source.
  • go install …/cmd/wardyn@latest gives the CLI only; wardynd needs -tags docker + a built ui/dist — use make setup or the image.

What you get

Capability What it does Status Detail
Governed runs Per-run identity in a gatewayless sandbox, driven from a terminal-first cockpit shipped ARCHITECTURE.md
Egress + approvals Only path out is the proxy; an unlisted host holds mid-flight — once, run, until, always shipped POLICIES.md
Record Mode Run once open, get the minimal policy, replay confined — 26 of 30 scored competitors have no policy-derivation loop at all shipped TRY-IT.md
Workspaces & secrets Mounts only what the workspace declares; secrets write-only, never readable back shipped OPERATIONS.md
Policies & confinement One policy picks the barrier: Fence (runc), Wall (gVisor), Vault (Kata, experimental); a host that can't enforce it refuses shipped POLICIES.md
Model access Key, subscription or Bedrock injected proxy-side; the sandbox holds an inert sentinel shipped TRY-IT.md
CI / headless No UI, no human: the governed run's exit code becomes the pipeline's shipped CI.md
Audit + attach Three append-only streams a Postgres trigger won't let you rewrite; attach live from browser or SSH shipped SSH.md

Everything else — env and policy reference, deployment, sample workspaces — is indexed in docs/.

Architecture at a glance

flowchart LR
  entry(["Human operator<br/>UI or wardyn CLI"])
  subgraph control["Control plane (trusted)"]
    wardynd["wardynd<br/>REST API + embedded UI<br/>policy · approvals · broker · audit"]
    pg[("Postgres<br/>append-only audit")]
    wardynd --> pg
  end
  subgraph sandbox["Per-run sandbox (UNTRUSTED) — gatewayless network"]
    %% rec declared first: else dagre routes the launch edge through it
    rec["wardyn-rec<br/>PTY recorder"]
    agent["Coding agent<br/>claude-code / codex-cli"]
    rec -->|"cast, brokered to wardynd"| proxy["wardyn-proxy<br/>L2 egress sidecar"]
    agent -->|"only path out"| proxy
  end
  entry --> wardynd
  wardynd -->|"launch (docker driver)"| agent
  proxy -->|"allowlisted L7, creds injected"| net(("Internet / APIs"))

A trusted control plane launches each run into an untrusted, gatewayless sandbox whose only path out is the wardyn-proxy sidecar, credentials injected there. Decision logs and masked casts flow back into the append-only audit log (THREAT-MODEL.md §8). Wardyn never adds power: a run reaches at most what you can, clamped by policy.

Honest security posture

What Wardyn does not defend against is published in full (THREAT-MODEL.md). Notable residuals:

  • The model-API channel is an unavoidable data-exit path. Prompts and tool calls are logged; nothing stops an agent encoding data into a permitted prompt.
  • Domain fronting and DNS-tunnel exfil need TLS interception, which ships only for operator-listed hosts (off by default) — most non-LLM egress stays opaque.
  • CC1/Fence shares the host kernel, and the 1-hour minted-token window before revocation is minimized by TTL, never eliminated.

Status

v0.4 (pre-alpha) is the last tagged release. v0.5 adds the Kubernetes runner substrate (alpha), owner-scoped admin/member RBAC, SSH into a running sandbox, and signed release images — merged into main and CI-green, the tag the remaining maintainer step. Two deployment paths, both running sandboxes: deploy/compose and the Helm chart deploy/helm/wardyn, not yet at Compose parity. Still unbuilt: SPIRE, OpenBao, an MCP gateway, arbitrary-domain TLS interception, OTLP/OCSF sinks, packaged team SSO, Compose's own L1 default-deny — see ROADMAP.md and CHANGELOG.md.

License and governance

Apache-2.0. Contributor sign-off via DCO (Signed-off-by). No enterprise/ directory, no hosted backend — every control above is in this repo and runs on your infrastructure, or it doesn't run. There is no paid product. CNCF Sandbox is the governance target. Contributions welcome — see CONTRIBUTING.md.

Directories

Path Synopsis
cmd
wardyn command
Command wardyn is the operator CLI for the Wardyn control plane.
Command wardyn is the operator CLI for the Wardyn control plane.
wardyn-aws-sso command
Command wardyn-aws-sso is Wardyn's in-sandbox AWS SSO credential capture helper.
Command wardyn-aws-sso is Wardyn's in-sandbox AWS SSO credential capture helper.
wardyn-git-helper command
Command wardyn-git-helper is the git credential helper for Wardyn-governed agent sandboxes.
Command wardyn-git-helper is the git credential helper for Wardyn-governed agent sandboxes.
wardyn-proxy command
Command wardyn-proxy is the L2 per-workspace egress sidecar: an HTTP forward proxy that enforces Wardyn's default-deny domain allowlist, method rules, and first-use approval; streams decision logs to the control plane; and injects third-party credentials proxy-side so secrets never enter the sandbox.
Command wardyn-proxy is the L2 per-workspace egress sidecar: an HTTP forward proxy that enforces Wardyn's default-deny domain allowlist, method rules, and first-use approval; streams decision logs to the control plane; and injects third-party credentials proxy-side so secrets never enter the sandbox.
wardyn-rec command
Command wardyn-rec is Wardyn's per-workspace PTY session recorder.
Command wardyn-rec is Wardyn's per-workspace PTY session recorder.
wardyn-runner command
wardyn-scan command
Command wardyn-scan is Wardyn's in-sandbox workspace scanner.
Command wardyn-scan is Wardyn's in-sandbox workspace scanner.
wardyn-tetragon-ingest command
Command wardyn-tetragon-ingest is the host-scoped eBPF GROUND-TRUTH sidecar: the SECOND of Wardyn's three advertised audit streams.
Command wardyn-tetragon-ingest is the host-scoped eBPF GROUND-TRUTH sidecar: the SECOND of Wardyn's three advertised audit streams.
wardyn-toolgate command
wardyn-toolgate is the in-sandbox relay that turns Claude Code's tool-use permission prompts into Wardyn approvals.
wardyn-toolgate is the in-sandbox relay that turns Claude Code's tool-use permission prompts into Wardyn approvals.
wardynd command
Command wardynd is the Wardyn control plane: REST API, embedded web UI, policy engine, approval FSM, token broker, and audit ingest.
Command wardynd is the Wardyn control plane: REST API, embedded web UI, policy engine, approval FSM, token broker, and audit ingest.
examples
workspaces/github-push command
Package main is a trivial Go program used as the github-push workspace.
Package main is a trivial Go program used as the github-push workspace.
internal
api
Attach-session holder registry + audited take-over.
Attach-session holder registry + audited take-over.
approval
Package approval implements the ApprovalRequest FSM service.
Package approval implements the ApprovalRequest FSM service.
audit
Package audit defines the append-only audit contract.
Package audit defines the append-only audit contract.
audit/sinks
Package sinks provides production audit.Sink implementations (syslog, webhook, file) plus a Fanout multiplexer and config wiring.
Package sinks provides production audit.Sink implementations (syslog, webhook, file) plus a Fanout multiplexer and config wiring.
auth/oidc
Package oidc implements human SSO for Wardyn via OpenID Connect (Dex-compatible).
Package oidc implements human SSO for Wardyn via OpenID Connect (Dex-compatible).
broker
Package broker implements Wardyn's token broker: the ONLY component that holds long-lived secrets and the sole issuer of short-lived run credentials.
Package broker implements Wardyn's token broker: the ONLY component that holds long-lived secrets and the sole issuer of short-lived run credentials.
cliutil
Package cliutil holds tiny env/flag helpers shared by Wardyn's cmd/* main packages (each cmd is its own `main` package, so these can't just live in one of them without the others importing "main"), plus ScrubChildEnv, the one env denylist shared by every host-exec'd third-party CLI child.
Package cliutil holds tiny env/flag helpers shared by Wardyn's cmd/* main packages (each cmd is its own `main` package, so these can't just live in one of them without the others importing "main"), plus ScrubChildEnv, the one env denylist shared by every host-exec'd third-party CLI child.
component
Package component provides the shared registry that backs Wardyn's pluggable component seams (identity provider, secret store, recording store, policy evaluator, …).
Package component provides the shared registry that backs Wardyn's pluggable component seams (identity provider, secret store, recording store, policy evaluator, …).
contentscan
Package contentscan implements Wardyn's OPTIONAL, off-by-default outbound content-inspection layer ("egress content inspection" / inadvertent-leak guardrail).
Package contentscan implements Wardyn's OPTIONAL, off-by-default outbound content-inspection layer ("egress content inspection" / inadvertent-leak guardrail).
db
Package db provides Postgres connection bootstrapping and schema migration for the Wardyn control plane.
Package db provides Postgres connection bootstrapping and schema migration for the Wardyn control plane.
egress
Package egress defines the L2 proxy decision model shared by cmd/wardyn-proxy and the control plane's policy/approval wiring.
Package egress defines the L2 proxy decision model shared by cmd/wardyn-proxy and the control plane's policy/approval wiring.
egress/evaluatortest
Package evaluatortest provides a reusable conformance suite for any egress.Evaluator implementation, so the blessed default (builtin) and a future alternate (OPA/Cedar) are held to the identical policy-verdict contract.
Package evaluatortest provides a reusable conformance suite for any egress.Evaluator implementation, so the blessed default (builtin) and a future alternate (OPA/Cedar) are held to the identical policy-verdict contract.
egress/proxy
Package proxy implements the L2 per-workspace egress sidecar (wardyn-proxy): an HTTP forward proxy that enforces the internal/egress decision model (default-deny domain allowlist, method rules, first-use approval), streams decision logs, and injects credentials proxy-side.
Package proxy implements the L2 per-workspace egress sidecar (wardyn-proxy): an HTTP forward proxy that enforces the internal/egress decision model (default-deny domain allowlist, method rules, first-use approval), streams decision logs, and injects credentials proxy-side.
gitremote
Package gitremote deterministically detects the git remotes configured in a local directory tree, so Wardyn can ground a composed run's GitHub grant on the workspace's ACTUAL remotes rather than an LLM guess.
Package gitremote deterministically detects the git remotes configured in a local directory tree, so Wardyn can ground a composed run's GitHub grant on the workspace's ACTUAL remotes rather than an LLM guess.
groundtruth
Package groundtruth maps kernel-level observations (from an eBPF sensor — specifically Tetragon) into Wardyn's append-only audit vocabulary (types.AuditEvent).
Package groundtruth maps kernel-level observations (from an eBPF sensor — specifically Tetragon) into Wardyn's append-only audit vocabulary (types.AuditEvent).
hostrules
Package hostrules holds the host-shape rules and artifact-registry tables the RUNTIME governance paths depend on — approval write-back, egress substitution, site-config validation and the artifact-redirect emitter.
Package hostrules holds the host-shape rules and artifact-registry tables the RUNTIME governance paths depend on — approval write-back, egress substitution, site-config validation and the artifact-redirect emitter.
identity
Package identity defines the per-run workload identity contract.
Package identity defines the per-run workload identity contract.
identity/embedded
Package embedded implements the default, SPIFFE-shaped JWT-SVID identity provider satisfying identity.Provider.
Package embedded implements the default, SPIFFE-shaped JWT-SVID identity provider satisfying identity.Provider.
identity/identitytest
Package identitytest provides a reusable conformance suite for any identity.Provider implementation, so the blessed default (embedded) and a future alternate (SPIRE) are held to the identical security contract.
Package identitytest provides a reusable conformance suite for any identity.Provider implementation, so the blessed default (embedded) and a future alternate (SPIRE) are held to the identical security contract.
ipguard
Package ipguard holds the SSRF private/reserved membership test shared by the egress proxy's policy guard (internal/egress/proxy) and the composer transport guard (internal/composer/backends/transport).
Package ipguard holds the SSRF private/reserved membership test shared by the egress proxy's policy guard (internal/egress/proxy) and the composer transport guard (internal/composer/backends/transport).
lifecycle
Package lifecycle implements workspace lifecycle automation: the Reaper loop finds RUNNING agent runs that have been idle past their policy's AutoStopAfterSec threshold and stops them, emitting a "run.autostop" audit event for each.
Package lifecycle implements workspace lifecycle automation: the Reaper loop finds RUNNING agent runs that have been idle past their policy's AutoStopAfterSec threshold and stops them, emitting a "run.autostop" audit event for each.
recording
Package recording provides storage and HTTP serving of asciicast session recordings produced by wardyn-rec.
Package recording provides storage and HTTP serving of asciicast session recordings produced by wardyn-rec.
recording/recordingtest
Package recordingtest provides a reusable conformance suite for any recording.Store implementation.
Package recordingtest provides a reusable conformance suite for any recording.Store implementation.
recordmode
Package recordmode is the deterministic core of Wardyn's "Recording Mode": it OBSERVES what a fully-open (allow-all-egress, broad-grant) run actually used — purely from already-captured audit events — and SYNTHESIZES a tightened, least-privilege RunPolicySpec the operator can review and promote.
Package recordmode is the deterministic core of Wardyn's "Recording Mode": it OBSERVES what a fully-open (allow-all-egress, broad-grant) run actually used — purely from already-captured audit events — and SYNTHESIZES a tightened, least-privilege RunPolicySpec the operator can review and promote.
runner
Package runner defines the target-agnostic sandbox lifecycle contract.
Package runner defines the target-agnostic sandbox lifecycle contract.
runner/orchestrator
Package orchestrator is the build-tag-free runner.Runner the control plane talks to.
Package orchestrator is the build-tag-free runner.Runner the control plane talks to.
runner/substrate
Package substrate defines the confinement-substrate sub-interface: the seam beneath the runner.Runner surface that lets a non-OCI microVM VMM (SmolVM, Firecracker, …) back a Confinement Class alongside the OCI/Docker substrate, without the control plane (or each substrate) re-implementing the runner contract.
Package substrate defines the confinement-substrate sub-interface: the seam beneath the runner.Runner surface that lets a non-OCI microVM VMM (SmolVM, Firecracker, …) back a Confinement Class alongside the OCI/Docker substrate, without the control plane (or each substrate) re-implementing the runner contract.
secretmask
Package secretmask implements Wardyn's output-masking layer for PTY capture and asciicast streams.
Package secretmask implements Wardyn's output-masking layer for PTY capture and asciicast streams.
secretstore
Package secretstore defines the at-rest secret storage contract.
Package secretstore defines the at-rest secret storage contract.
secretstore/pg
Package pg implements secretstore.Store backed by an age-encrypted Postgres column (the `secrets` table in the core schema).
Package pg implements secretstore.Store backed by an age-encrypted Postgres column (the `secrets` table in the core schema).
secretstore/secretstoretest
Package secretstoretest provides a reusable conformance suite for any secretstore.Store implementation.
Package secretstoretest provides a reusable conformance suite for any secretstore.Store implementation.
setup
Package setup provides host-environment detection for the first-run setup surface (GET /api/v1/setup/status): which resident coding-agent CLIs are present, and the OS/WSL posture the environment-step copy keys off.
Package setup provides host-environment detection for the first-run setup surface (GET /api/v1/setup/status): which resident coding-agent CLIs are present, and the OS/WSL posture the environment-step copy keys off.
sidecar
Package sidecar holds the small brokered-PUT plumbing shared by Wardyn's in-sandbox result-uploader binaries (wardyn-scan): validate WARDYN_PROXY_URL/WARDYN_RUN_ID, build the brokered result URL, and PUT a JSON body.
Package sidecar holds the small brokered-PUT plumbing shared by Wardyn's in-sandbox result-uploader binaries (wardyn-scan): validate WARDYN_PROXY_URL/WARDYN_RUN_ID, build the brokered result URL, and PUT a JSON body.
store
Package store provides typed CRUD over the Wardyn schema using pgx/v5.
Package store provides typed CRUD over the Wardyn schema using pgx/v5.
subscription
Package subscription yields the operator's LIVE Anthropic subscription OAuth access token from the resident ~/.claude credentials, so the egress proxy can inject a fresh token per request instead of the sandbox holding a COPY that goes stale (access-token expiry + refresh-token rotation lock the copy out).
Package subscription yields the operator's LIVE Anthropic subscription OAuth access token from the resident ~/.claude credentials, so the egress proxy can inject a fresh token per request instead of the sandbox holding a COPY that goes stale (access-token expiry + refresh-token rotation lock the copy out).
types
Package types defines Wardyn's core domain vocabulary: the four nouns (AgentRun, RunPolicy, CredentialGrant, ApprovalRequest) plus the audit event shape.
Package types defines Wardyn's core domain vocabulary: the four nouns (AgentRun, RunPolicy, CredentialGrant, ApprovalRequest) plus the audit event shape.
version
Package version holds Wardyn's ONE shipped version string.
Package version holds Wardyn's ONE shipped version string.
workspacescan
Package workspacescan deterministically detects a local directory's (or a cloned repo's) development conventions — languages, package managers, implied egress registries, dev-container/Dockerfile presence, tools, and git remotes — so Wardyn can onboard a workspace with a profile grounded in what's ACTUALLY in the tree, not an LLM guess.
Package workspacescan deterministically detects a local directory's (or a cloned repo's) development conventions — languages, package managers, implied egress registries, dev-container/Dockerfile presence, tools, and git remotes — so Wardyn can onboard a workspace with a profile grounded in what's ACTUALLY in the tree, not an LLM guess.
pkg
client
Package client is the public Go SDK for the Wardyn control plane.
Package client is the public Go SDK for the Wardyn control plane.
test
awsssofake
Package awsssofake is a local, unsigned fake of the two AWS IAM Identity Center (SSO) HTTP services the AWS CLI/SDK talks to during `aws sso login` and later role-credential resolution:
Package awsssofake is a local, unsigned fake of the two AWS IAM Identity Center (SSO) HTTP services the AWS CLI/SDK talks to during `aws sso login` and later role-credential resolution:
conformance
Package conformance is the driver-agnostic parity gate for runner.Runner implementations.
Package conformance is the driver-agnostic parity gate for runner.Runner implementations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL