Skip to main content
The TrustGuard Codex plugin uses Codex lifecycle hooks (not Codex External guardrails / Prisma AIRS) and POST /v1/evaluate. One org collector API key is shared across the company. Codex has no “import plugin from GitHub” marketplace flow like Cursor. You install from the repo (local) or IT deploys hooks + config (enterprise).

Console setup

  1. Create a Codex collector (Catalog → IDE & coding agents).
  2. Mint a tgk_… API key on the Auth tab (shown once — store it).
  3. Assign a default policy on the Policies tab.

Local / pilot

make install-local:
  • Builds trustguard-codex and installs it under ~/.trustguard/bin
  • Copies the plugin to ~/.codex/plugins/trustguard
  • Writes ~/.codex/hooks.json with absolute paths to the bootstrap scripts
    (Codex runs hooks from the session cwd, so relative paths are unreliable)
Then write the API key config:
In Codex run /hooks, trust the TrustGuard definitions, and send a test prompt.

Enterprise

IT deploys more than the API key file. Codex does not pull hooks from a marketplace; managed hooks must already exist on disk.

1. Managed API key config

When this file includes api_key, that key, data_url, and fail_mode are locked (user ~/.trustguard/codex.json and env cannot override them). Soft prefs (timeout_ms, transform_action, events, consumer_id) still layer from the user file.

2. Enforce hooks (requirements.toml)

Example (see the full file in the plugin repo):
Source: docs/enterprise-requirements.toml in the plugin repo. Exact keys can vary by Codex version — confirm against Codex hooks docs. With allow_managed_hooks_only = true, developers cannot disable managed hooks from /hooks.

Verify

  1. In Codex run /hooks and confirm TrustGuard hooks are listed (and managed under enterprise policy).
  2. Send a test prompt.
  3. Confirm the event in TrustGuard Activity (consumer_id is typically codex:<user> or codex:<email> when the payload includes email).
Smoke-test the binary (optional):

What is evaluated

Attributes

  • attributes.collector.type = "ide"
  • attributes.codex.event, cwd, model, turn
  • consumer_id prefixed codex: (email from payload when present, else configured / OS fallback)