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.1.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.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codex_hookkit-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6a14a9eb635e20b54b8362233789e403d4cb0c494a637006e8f7b24e5e4df748
MD5 074f72b2cf96f64e11a19c8aa89f4220
BLAKE2b-256 9940767bc45dd718b8c8f43cbe26771604b5f175c95a570c3ea48c67b508d493

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codex_hookkit-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff81b6ab1cb9f8c5622dd0162c96019d60e582e20a1b93bbf4239e73a38e6b3f
MD5 fb984d95641bf0e181b12d7be0f702f1
BLAKE2b-256 8fbbc2649435045115b6efcc01a22463e4a8fc86a74592d56ed65253333247b8

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