<!-- Markdown copy of https://jevhub.io/jev-codex (Jev in Codex: set it up and trust the hook · Jev Hub). The HTML page is the original. -->

[ Guide ]

# Jev in Codex: set it up and trust the hook

Jev in Codex: install the TypeSafe skill, register a PermissionRequest hook, trust it in /hooks and fix the missing API key. Checked 25 October 2026.

Published 25 October 2026By Jev Hub

[Back to Learn](https://jevhub.io/learn)

[ TLDR ]

- Jev cannot replace the model behind Codex, but TypeSafe's skill teaches Codex to write programs that call Jev, and a hook can let Jev approve routine shell commands.
- The skill installs with one command that asks you to choose Codex.
- The hook has two Codex-only steps that trip people up: you must trust each new hook in /hooks, and the hook process did not receive the API key from the environment in OpenRouter's test, so the key belongs in a git-ignored .env file.

## Jev in Codex, at a glance

|  | What to do | Where it is documented |
| --- | --- | --- |
| Install | npx skills add typesafe-ai/skills --skill typesafe-ai, then choose Codex when asked | TypeSafe's agent-skill page |
| Use it | Say "use the TypeSafe skill" in your prompt | TypeSafe's agent-skill page |
| Update | npx skills update | TypeSafe's agent-skill page |
| Approve shell commands with Jev | A PermissionRequest hook in .codex/hooks.json: matcher Bash, timeout 15, same Bun script as Claude Code | OpenRouter's coding-agent cookbook |
| Trust | The project's .codex/ layer must be trusted, and each new or changed hook reviewed and trusted in /hooks | OpenRouter's coding-agent cookbook |
| Key for the hook | Put OPENROUTER_API_KEY in a git-ignored .env file in the project: the hook process did not inherit it from the environment | OpenRouter's coding-agent cookbook |

Commands and settings are from TypeSafe's agent-skill page and OpenRouter's cookbook, read on 25 October 2026. Check the linked pages for current commands.

## Can Jev work with Codex?

Yes, beside it. TypeSafe's documentation says Jev is not a coding-agent language model, so it cannot be the model behind Codex. It can help Codex write code that calls Jev, and it can act as a fast judge on the shell commands Codex wants to run.

- [Jev in Claude Code: what you can build](https://jevhub.io/jev-claude-code)
- [Jev in OpenCode: skill, approvals and Zen](https://jevhub.io/jev-opencode)

## How do I install Jev in Codex?

TypeSafe's agent-skill page lists Codex among the agents the skills installer supports. Run this command and choose Codex when it asks. The install is project-local by default; add `-g` to make it global. Use one install method only, because two leave duplicate copies.

Codex · install the skill

```
npx skills add typesafe-ai/skills --skill typesafe-ai
```

Then say "use the TypeSafe skill" in your prompt. To update later, run this:

Codex · update the skill

```
npx skills update
```

Read the skill file before you install it: skills run with Codex's permissions. The repository, [typesafe-ai/skills](https://github.com/typesafe-ai/skills), is MIT-licensed.

## How do I set up the Jev permission hook in Codex?

OpenRouter's cookbook uses the same TypeScript script as Claude Code, run with Bun. In Codex you register it in `.codex/hooks.json` as a `PermissionRequest` hook with the matcher `Bash`, an optional status message and a timeout of 15. A fixed risk list in code sends dangerous commands, such as recursive deletes, force pushes, publishing and credential paths, straight to the normal prompt. Everything else goes to Jev, and a command is approved only when every score is at least 0.9.

Two Codex steps are easy to miss. Codex loads project hooks only when the project's `.codex/` layer is trusted, and you must also review and trust each new or changed hook through `/hooks` in the command-line app. Until then every command prompts, as if the hook were not there.

## Why does the Jev hook say no key in Codex?

In OpenRouter's captured session, the hook process did not receive `OPENROUTER_API_KEY` from the environment, even with `shell_environment_policy.inherit` set to `all`, so every command fell back to the prompt. The fix the cookbook gives is to put the key in a `.env` file in the project, which Bun reads from the hook's working directory, and to keep that file out of Git.

Codex also fills the command's description with an approval question, which does not work as a task. The script spots the `turn_id` field, drops the task for Codex and asks only the reversibility question. That means Codex relies a little more on the fixed risk list than Claude Code does.

## What can I build with Codex and Jev?

Two uses that TypeSafe has published as cookbooks, with the figures it reports. They are TypeSafe's own and not independently checked:

- **Turn plain requests into function calls.** TypeSafe's function-calling cookbook maps a typed command such as "plot rolling correlation between nvda and spy for the past month" to a Python function and its arguments, with a confidence for the call (0.91 for that one). The setup has ten functions and 54 questions per command, and it ran on Jev 1.12.
- **Give a router a memory.** TypeSafe's memory cookbook adds a second Jev question that decides whether a support ticket states a lasting fact worth saving. In its example, routing the later messages correctly went from 2 of 6 without memory to 6 of 6 with it, on Jev 1.13.0 (28 September 2026). The save threshold of 0.5 is described as a starting value.
- **Check before an agent acts.** The same approval pattern works for any tool call: send the action and the task to Jev as two yes or no questions and act only above a threshold you set from your own examples.

- [Confidence routing: send each answer where it belongs](https://jevhub.io/confidence-routing)

## What goes wrong in Codex?

The snags TypeSafe and OpenRouter document:

- **The skill is not used.** Name it in your prompt, confirm the installer targeted Codex, then restart.
- **Every command still prompts.** Trust the project's `.codex/` layer, then trust the hook in `/hooks`, then check the key is in `.env`.
- **The hook approves too much or too little.** Raise or lower the 0.9 threshold only after reading your own results, and add risky commands to the fixed list first.
- **Jev only sees the request.** It cannot tell that a command reads a secret unless the path or text shows it, so the fixed list, not Jev, is the security boundary.

## Common questions

Not as the model behind Codex, because Jev returns structured decisions, not code. You can install TypeSafe's skill so Codex writes programs that call Jev, and you can use Jev as a permission-prompt judge through a hook.

Run this command and choose Codex when asked, then say "use the TypeSafe skill" in your prompt.

Terminal

```
npx skills add typesafe-ai/skills --skill typesafe-ai
```

In .codex/hooks.json, as a PermissionRequest hook with the matcher Bash and a timeout of 15. Codex loads it only when the project's .codex/ layer is trusted, and you must also trust the hook in /hooks.

In OpenRouter's test, the hook process did not receive OPENROUTER_API_KEY from the environment even with inherit set to all. The fix is a git-ignored .env file in the project, which Bun reads from the hook's working directory.

Run this command.

Terminal

```
npx skills update
```

Not for Codex. Codex puts an approval question where other agents put a task, so OpenRouter's script drops the task for Codex and asks only whether the command is reversible and contained to the project.

## Sources

Written by Jev Hub from the sources below and checked against them on 25 October 2026. Where a figure is a company's own claim, the article says so.

- [TypeSafe docs: the TypeSafe agent skill (read 25 October 2026)](https://docs.typesafe.ai/agent-skill)
- [GitHub: typesafe-ai/skills (MIT licence, read 25 October 2026)](https://github.com/typesafe-ai/skills)
- [OpenRouter cookbook: auto-approve coding-agent permission prompts with Jev (read 25 October 2026)](https://openrouter.ai/docs/cookbook/coding-agents/auto-approve-permission-prompts-with-jev)
- [TypeSafe cookbook: function calling (read 25 October 2026)](https://docs.typesafe.ai/cookbooks/function_calling)
- [TypeSafe cookbook: basic memory (read 25 October 2026)](https://docs.typesafe.ai/cookbooks/basic_memory)
- [TypeSafe docs: Jev with coding agents (read 25 October 2026)](https://docs.typesafe.ai/introduction/coding-agents)

## Related content

- [Jev in OpenCode](https://jevhub.io/jev-opencode)
- [Jev in Cursor](https://jevhub.io/jev-cursor)
- [Jev on OpenRouter](https://jevhub.io/jev-openrouter)
