
Product
Socket Threat Intel Now Shows Which Malware Campaigns Were Blocked or Detected
Socket Threat Intel now shows which malware campaigns were blocked or detected in your organization, with links to scans and Firewall events.
pi-codex-tools
Advanced tools
Give grammar-capable OpenAI/Codex models the Codex apply_patch tool in Pi without changing Pi's normal tools for other models.
apply_patch — sends Codex's Lark grammar as an OpenAI custom tool, so patches are not JSON-wrapped.openai-codex-responses or openai-responses plus model.compat.supportsOpenAIGrammarTools === true; model names alone are never enough.edit and write tools with apply_patch; other active tools are preserved. Switching back restores only the file tools that were active before the switch.pi install npm:pi-codex-tools
For a one-off run:
pi -e /path/to/pi-mono/packages/pi-codex-tools
The current Codex source does not define separate read_file or write_file tools: file inspection is normally done through shell commands and file mutation through apply_patch. This package keeps Pi's bounded read and bash tools, and uses apply_patch in place of Pi's edit and write tools for supported models. Because Pi does not provide Codex's OS-level filesystem sandbox, apply_patch runs only on Linux and fails closed on unsupported platforms. It also requires a Pi model runtime that advertises compat.supportsOpenAIGrammarTools; older runtimes leave the tool inactive.
| Codex surface | Decision |
|---|---|
apply_patch | Included; it is a materially different freeform grammar tool. |
shell_command | Deferred; Pi already has the bounded shell backend, while a faithful adapter needs Codex's approval and working-directory contract. |
exec_command + write_stdin | Deferred; persistent PTY sessions need a separate process/session design. |
view_image | Deferred; Pi's read already sends supported images as attachments. |
update_plan | Deferred; it is workflow metadata rather than a capability-specific file tool. |
Code Mode exec + wait | Deferred; it requires a real sandbox for model-authored JavaScript, not Node's ordinary vm wrapper. |
These choices are based on the Codex tool specifications in codex-rs/core/src/tools, the model profiles in codex-rs/models-manager/models.json, and the Code Mode protocol. They intentionally keep this package focused on the one tool with a distinct transport and model-facing contract.
apply_patch is line-oriented rather than byte-oriented:
*** Add File requires at least one + line and writes a trailing newline. A +-only hunk creates a one-newline file, not a zero-byte file.bash when exact byte-level output or a truly empty file is required.These behaviors intentionally match Codex apply_patch.
The provider contract is runtime-specific: use Pi 0.83.0 or newer for OpenAI grammar-tool support. For a manual smoke test, start Pi with this extension and a model that advertises supportsOpenAIGrammarTools, then verify that a file change appears as an apply_patch call and not as edit, write, or bash.
npm run -w packages/pi-codex-tools check
npm test -w packages/pi-codex-tools
npm run -w packages/pi-codex-tools pack:dry-run
Install/update telemetry is disabled in CI and can be disabled with PI_OFFLINE=1, PI_TELEMETRY=0 or PI_TELEMETRY=false, or Pi's enableInstallTelemetry: false setting. See SECURITY.md.
This package is Apache-2.0 licensed because its grammar/parser behavior is adapted from OpenAI Codex. See NOTICE.
FAQs
Codex-compatible apply_patch tooling for Pi's grammar-capable OpenAI models.
The npm package pi-codex-tools receives a total of 0 weekly downloads. As such, pi-codex-tools popularity was classified as not popular.
We found that pi-codex-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket Threat Intel now shows which malware campaigns were blocked or detected in your organization, with links to scans and Firewall events.

Security News
Fixes for eMudhra and Brotli are out. Getting them everywhere they’re needed means tracking down bundled libraries, runtimes, and certificate stores.

Threat Research
/Security News
Socket uncovered secret-stealing workflows that ran in LiteLLM’s GitHub repository 11 days before the supply chain attack on PyPI and Docker.