Here is the text formatted in Markdown:

AgentGuard

AgentGuard is reliability middleware layered on top of a thin Agent platform. It takes an Agent Run (normally a flat log of model calls, tool calls, and policy decisions) and turns it into a single-root, nested span tree, then uses that tree to drive deterministic recovery and budget control.

The core claim: The trace is a sensor, not a dashboard. Failure detection, diagnosis, recovery, and budget policies read spans to decide, and write their decisions back as spans nested under the step that triggered them, so diagnosis, repair, and verification are all evidence in the same tree.

Features

  • Glass Box span tree - Every event is a span carrying a category (orchestration, model_call, tool_call, checkpoint, policy_decision, human_approval, recovery), an actor (human/agent/middleware), a parent, an attempt index, and a duration with its measurement source. runId is the trace id; eventId is the span id.
  • Redaction before persistence - Configured Ark/API-auth credential values are scrubbed by literal value on top of pattern matching before anything is written, and previews redact before truncation. An evidence test serializes a run that leaked ARK_API_KEY and asserts the secret never appears.
  • Real instrumentation - No synthetic telemetry. Codex JSONL items become model/tool spans with genuine exit codes; runtime_crash performs a real docker kill so the error span carries a true non-zero exit.
  • Closed-loop recovery - An incident opens, a deterministic diagnosis issues (root cause, evidence, confidence, failure signature), a checkpointed retry/restart-resume runs, and RECOVERY_VERIFIED lands on the follow-up turn, all nested under the failing span, with attemptIndex marking redone work.
  • Proactive budget control - Tiered pre-turn prompt wrap/gate, mid-turn projection cancel driven by accumulated span data, and compress-on-recovery (soft automatic, hard HITL with the approval attributed to actor human).
  • Trace UI - A floating, draggable AgentGuard window with a run list, a nested span tree with actor badges and qualified durations, filter chips that preserve hierarchy, expandable span detail, and secret-free JSON export.

LLM Wiki (Large-Task Memory)

Every created Agent ships with an LLM-wiki workflow embedded in its platform-generated AGENTS.md. When a conversation task is deemed large (a whole app, a multi-component feature, or work spanning many turns/sessions), the Agent scaffolds and maintains a wiki/ directory in its workspace:

  • wiki/index.md (page catalog)
  • wiki/log.md (append-only timeline)
  • Concise interlinked overview/architecture/component/decision pages updated as the work proceeds.

Source code remains the source of truth; the wiki is advisory analysis. Heavier upkeep (scaffold, ingest, query, lint) is delegated to a pre-seeded @wikier subagent (.codex/agents/wikier.toml) so the main thread stays focused on coding.

Tech Stack

  • Frontend: React 19 + TypeScript + Vite (with Vitest), rendering the Playground and the AgentGuard trace window.
  • Control plane: Fastify 5 (Node.js) with Zod validation; async Run state; serves the compiled UI and a bearer-token-protected API.
  • Persistence: Single-node JSON store (atomic single-file writes), Agent workspaces on disk, Codex thread history under codex-home/.
  • Agent runtime: Codex CLI, run inside a disposable Docker/Colima/Podman container per local turn (ContainerCodexRunner) or as a child process on ECS (CodexRunner), both resuming the stored Codex thread, backed by the Volcengine Ark Responses API.
  • Testing: Vitest across both workspaces; npm run check runs typecheck, tests, and production builds.

Built With

Share this project:

Updates

Submission history