# openai-agents-python: Validate Codex inputs as JSON

> News on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/openai-agents-python-validate-codex-json-parameters
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, openai-agents-python v0.26.0 lets strict Codex tool models accept JSON arrays for tuple fields and strings for enum fields. The default remains Python validation. Opt in with `parameter_validation_mode="json"`

**Not for:** Codex CLI transport settings.

Subjects: codex, openai

Do first: Set `parameter_validation_mode="json"` when creating the experimental `codex_tool`.

## Short answer
As of November 2026, openai-agents-python v0.26.0 (published 2026-11-24) adds opt-in JSON validation for Codex tool parameters. Strict models can accept JSON arrays for tuple fields and strings for enum fields. Existing tools retain Python-mode validation.

## What to do
1. Supply the Pydantic model through `parameters` and set `parameter_validation_mode="json"` on `codex_tool`.
2. Accepted mode values are `"python"` and `"json"`; the default is `"python"`. JSON mode calls `model_validate_json`; Python mode calls `model_validate` on decoded Python values.
3. Invalid mode values raise `UserError` with `parameter_validation_mode must be "python" or "json".`

## Limits and open questions
- This option changes parameter validation, not image grants or approval policy.
- It does not permit malformed JSON or bypass model validation.

Not for: Codex CLI transport settings.

## Sources
- [v0.26.0 release](https://github.com/openai/openai-agents-python/releases/tag/v0.26.0), openai-sdks[bot], published 2026-11-24.
- [JSON validation option](https://github.com/openai/openai-agents-python/pull/6067), seratch.
- [Validation implementation](https://github.com/openai/openai-agents-python/commit/54492d112b5c3366cc30f35abd60c46fa92140c2), seratch.

## Checked
2026-11-24; read the release page and linked PR and migration change; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.