How a script, hook or CLI can tell it was started by each harness, and which session started it. Children inherit these variables, so treat them as hints that an agent is involved, not as proof that no person is watching.
Detecting the harness
| Question | Codex CLIchecked at 0.164.0 |
|---|---|
| The variable to check |
|
| Which processes get it | |
| Which session started the command |
Codex says these labels are for correlation, not authorization: shell startup files and child processes can change or remove them. |
Relying on it
| Question | Codex CLIchecked at 0.164.0 |
|---|---|
| Telling the agent's commands from yours | Partly Use |
| Signs that nobody will answer a prompt | Commands the model runs get |
| Removing or overriding it | Not supported No. |