workos-audit-harness
Audit logging for AI coding agents: one event vocabulary, six working integrations, and an honest account of where each place you can emit from tops out.
If you build an agent harness, emit audit events from your own backend. Your servers already see the session, the model, and every tool call the agent makes, and a customer's developer cannot rewrite them there. That is the only place an event's content can be attested, and it's the architecture we recommend. Start with the guide Add enterprise-grade audit logs to your AI harness below and the shared event taxonomy in packages/audit-core.
If you operate a fleet and your vendors haven't done that yet, instrument the endpoint instead. The plugins here emit from Claude Code, Codex, OpenClaw, OpenCode, Hermes, and pi today, with no vendor cooperation required. Events are authenticated per device and attributed server-side, but their content is composed on a machine the user administers, so it can be fabricated or withheld; see the trust model before building on the result.
The two compose. A vendor-emitted spine (session, turn, and tool-call ids from the backend) correlated with endpoint-emitted enrichment (repo, branch, cwd, device, local approvals) gives you both halves: the backend sees the conversation, the endpoint sees the machine, and claims from one that don't reconcile against the other are detectably false.
This repo contains six agent integrations, a fleet-deployment proxy and a chat console over the resulting audit trail, sharing one CLI harness and one set of audit schemas:
| Package | What it does |
|---|
packages/audit-core | Shared core for every integration: config resolution, the emit/query paths, audit schemas, and the workos-audit-harness CLI. |
packages/claude-plugin | Claude Code plugin: emits session/prompt/tool/turn events to WorkOS and exposes a workos_audit_query MCP tool. |
packages/codex-plugin | Codex plugin: same lifecycle events + MCP audit query, with Codex's hook model. |
packages/openclaw-plugin | OpenClaw plugin: emits native session/message/agent/LLM/tool/turn events and exposes WorkOS audit query/status tools. |
packages/opencode-plugin | OpenCode plugin: emits session/prompt/tool/permission/turn events via native hooks and exposes WorkOS audit query/status tools. |
packages/hermes-plugin | Hermes Agent plugin: Python hooks shell out to bundled Node scripts to emit session/prompt/tool/approval/subagent/turn events, plus audit query/status tools. |
packages/pi-extension | Extension for pi-coding-agent and the workos-audit-harness CLI. |
packages/proxy | Cloudflare Worker ingestion proxy: laptops authenticate with a device cert over mTLS instead of carrying a WorkOS API key. Deployable to any Cloudflare account. |
packages/chat | AuthKit-gated AI chat console over the audit trail: ask "who ran bash commands yesterday?" and the model answers from the Audit Logs Export API. |
packages/site | Marketing & docs site (Next.js 15 + Tailwind v4). It also hosts the workos-audit-recipe SKILL.md. |
Install
Quick install (all agents at once)
npx github:workos/workos-audit-harness
The installer detects which supported agents are on your machine (pre-selected in the picker) and installs the audit plugin for each one you confirm, so you don't repeat the setup per agent. Non-interactive: --yes installs for everything detected, --agents claude,codex picks explicitly, --list just shows what's detected. From a clone, the same thing is npm run quick-install.
Prefer manual setup, or need the details for one agent? The per-agent sections below are what the installer automates.
Claude Code
/plugin marketplace add workos/workos-audit-harness
/plugin install workos-audit@workos-audit-plugins
Then restart Claude Code and run /workos-audit-setup to wire up credentials. See packages/claude-plugin/README.md.
Codex
git clone https://github.com/workos/workos-audit-harness.git
cd workos-audit-harness
codex plugin marketplace add .
Install workos-audit from the marketplace inside Codex, then restart. See packages/codex-plugin/README.md.
OpenClaw