Skip to main content

Small helpers for building Codex hook guards against upstream hook schemas.

Project description

codex-hookkit

Small helpers for building Codex hook guards against upstream Codex hook schemas.

This package intentionally starts small:

  • vendored snapshots of openai/codex generated hook schemas
  • stdin parsing for Codex hook payloads
  • JSON-schema validation helpers
  • allow / deny output builders
  • a minimal command guard CLI

Install

uv add codex-hookkit

CLI

Use codex-hookkit guard as a Codex hook command. It reads one hook payload from stdin, validates it against the vendored upstream schema, and exits:

  • 0 for allowed payloads
  • 2 with a stderr reason for denied payloads
codex-hookkit guard --schema pre-tool-use

Python API

from codex_hookkit import HookPayload, SecretPolicy, deny

payload = HookPayload.from_stdin(schema="pre-tool-use")
decision = SecretPolicy.default().evaluate(payload)

if decision.denied:
    raise SystemExit(deny.stderr_exit(decision.reason))

JSON output helpers are also available for Codex hook contracts that consume structured output.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_hookkit-0.0.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_hookkit-0.0.2-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file codex_hookkit-0.0.2.tar.gz.

File metadata

  • Download URL: codex_hookkit-0.0.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codex_hookkit-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e6b7dcb7a49e5f7f8981c226f23755df48ce312865016e86ecfd4ce5601c5b80
MD5 0725799bd6cdcffbd7f203311e0920c5
BLAKE2b-256 9090d9eb1a402b86745b6e1a08671f42f5155cee0d7000f35c08dadd5efb62a3

See more details on using hashes here.

File details

Details for the file codex_hookkit-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: codex_hookkit-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codex_hookkit-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 200aeae7a83a181b1c26626d84634f21fcf9d0b4994f0d61ea4fc2b2f00f64cb
MD5 3e5ca2301703af32cf842e1b3e74ea1c
BLAKE2b-256 c2a4b52992399710fc3573f151c60ad30171018d7c7259efbb9757ab190ed38b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page