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
- Create a Codex collector (Catalog → IDE & coding agents).
- Mint a
tgk_…API key on the Auth tab (shown once — store it). - Assign a default policy on the Policies tab.
Local / pilot
make install-local:
- Builds
trustguard-codexand installs it under~/.trustguard/bin - Copies the plugin to
~/.codex/plugins/trustguard - Writes
~/.codex/hooks.jsonwith absolute paths to the bootstrap scripts
(Codex runs hooks from the session cwd, so relative paths are unreliable)
/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):
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
- In Codex run
/hooksand confirm TrustGuard hooks are listed (and managed under enterprise policy). - Send a test prompt.
- Confirm the event in TrustGuard Activity (
consumer_idis typicallycodex:<user>orcodex:<email>when the payload includes email).
What is evaluated
Attributes
attributes.collector.type = "ide"attributes.codex.event, cwd, model, turnconsumer_idprefixedcodex:(email from payload when present, else configured / OS fallback)