# Codex: Error loading config.toml

> The file is not valid TOML. The exact message, why Codex prints it, and the fix.

_Updated November 23, 2026 · Checked against Codex 0.157.1, reproduced in EnvHaven 1.9.0_

## The message

```text
Error loading config.toml:
~/.codex/config.toml:1:19: invalid float, expected `nan`
  |
1 | approval_policy = never
  |                   ^^^^^
```

## What it means

The file is not valid TOML. Here the value `never` is unquoted, so the TOML parser reads it as a number and fails; every string value needs quotes.

## Fix

1. Quote string values: `approval_policy = "never"` and `sandbox_mode = "danger-full-access"`.
2. Check the file at the line and column in the message; the caret points at the problem.
3. Run `codex` again. It refuses to start until the file parses.

## In an EnvHaven workspace

Only if the file is edited by hand. The workspace writes a valid config.toml on first boot.

## Where this comes from

This message was produced by Codex (Codex 0.157.1) itself, in a throwaway EnvHaven 1.9.0 container, on 2026-11-23; the text above is copied from that output.

## Keep reading

- [Codex](https://envhaven.com/agents/codex)
- [Is Codex down?](https://envhaven.com/status/codex)
- [Every agent error](https://envhaven.com/errors)

Source: https://envhaven.com/errors/codex/error-loading-config-toml
