Skip to content

Scan your repositories with Codex Security every night

Nightly AI security scans of your repositories, with no keys on the VM.

  • Security
  • 10 minutes
  • Tested Nov 16, 2026
Deploy on exe.dev

Shelley handles the setup. About 10 minutes.

Prefer a terminal?
curl -fsSL https://exe.dev/deploy/codex-security/prompt.txt | ssh exe.dev new --prompt=/dev/stdin

Codex Security is OpenAI's AI security scanner. It reads a repository the way an application security engineer would: it writes a threat model, follows data from inputs to dangerous calls, and checks each candidate finding before it reports it with a severity, the code path, and a suggested fix. It's Apache-2.0 licensed; version 0.10.0 came out on November 12, 2026.

This page runs it every night on an exe.dev VM, over the repositories you list. It scans only repositories with new commits and emails you only findings it hasn't reported before. The model comes from exe.dev's LLM integration and the code from the GitHub integration, so neither a model key nor a GitHub token is on the VM.

What you get#

  • Docker on every boot and the Codex Security 0.10.0 image pulled
  • ~/security/nightly-scan.sh, which scans the repositories in ~/security/repos.txt through exe.dev's LLM integration, with no model key on the VM
  • A systemd timer, codex-security-scan.timer, that runs it every night around 03:00 UTC and emails you the new findings
  • A test run of the script that ends with Nothing to scan.
What's running, and where
Private ssh my-codex-security.exe.xyz the list of repositories, settings, reports, and logs
my-codex-security.exe.xyz exe.dev VM
Codex Security ghcr.io/openai/codex-security:0.10.0 in Docker ~/security/results
Nightly scan nightly-scan.sh, run by the codex-security-scan systemd timer ~/security/repos.txt, ~/security/scan.env

Deploy with Shelley#

Click Deploy and Shelley will set up Codex Security on a new VM, then check that it works. No config-file wrangling required.

Prefer a terminal?
curl -fsSL \
  https://exe.dev/deploy/codex-security/prompt.txt \
  | ssh exe.dev new --prompt=/dev/stdin
What Shelley is told
Set up Codex Security on this VM by following the exe.dev recipe at https://exe.dev/deploy/codex-security.md from top to bottom.

The recipe's example VM name is my-codex-security. This VM's name is the output of `hostname`: use it wherever the recipe writes my-codex-security. Skip the step that creates the VM; you are on it.

You are done when all of these are true. Check each one yourself:
- Docker on every boot and the Codex Security 0.10.0 image pulled
- `~/security/nightly-scan.sh`, which scans the repositories in `~/security/repos.txt` through exe.dev's LLM integration, with no model key on the VM
- A systemd timer, `codex-security-scan.timer`, that runs it every night around 03:00 UTC and emails you the new findings
- A test run of the script that ends with `Nothing to scan.`

Run the commands in "Install by hand", in order, and the check at its
end. Don't add repositories to `~/security/repos.txt` and don't start a
scan: the repositories need GitHub integrations, which the owner adds
from their computer. Finish by telling the owner to follow "Choose the
repositories".

Finish with the URLs I should open.

Also at /deploy/codex-security/prompt.txt. The recipe it follows is /deploy/codex-security.md.

Install#

On exe.dev, click Deploy to have Shelley set it up on a new VM. Or create it yourself:

Install by hand

On your computer:

ssh exe.dev new --name=my-codex-security
ssh my-codex-security.exe.xyz

Get Codex Security#

On the VM, start Docker, now and on every boot, and fetch OpenAI's Compose file and seccomp profile for the container, at the release this page was tested with:

sudo systemctl enable --now docker.service
mkdir -p ~/security && cd ~/security
base=https://raw.githubusercontent.com/openai/codex-security/npm-v0.10.0
curl -fsSLO $base/compose.yaml
curl -fsSL --create-dirs -o docker/codex-security-seccomp.json $base/docker/codex-security-seccomp.json
mkdir -p results state && chmod 700 results state
CODEX_SECURITY_IMAGE=ghcr.io/openai/codex-security:0.10.0 docker compose pull codex-security

The last line pulls the 1.4 GB image. The container runs as your user, with every Linux capability dropped and the seccomp profile applied.

Connect it to the LLM integration#

On the VM, give Codex, inside the container, a profile that sends its requests to exe.dev's LLM integration:

cat > ~/security/state/review.config.toml <<'EOF'
model_provider = "exe-llm"

[model_providers.exe-llm]
name = "exe.dev LLM integration"
base_url = "https://llm.int.exe.xyz/v1"
wire_api = "responses"
env_key = "EXE_LLM_KEY"
EOF

The script sets EXE_LLM_KEY to a placeholder; the integration adds the real credentials at exe.dev's edge.

Install the nightly script#

On the VM, download nightly-scan.sh and start an empty list of repositories:

cd ~/security
curl -fsSLO https://exe.dev/deploy/codex-security/nightly-scan.sh
chmod 755 nightly-scan.sh
printf '# One GitHub repository per line, as owner/repo\n' > repos.txt

For each repository in repos.txt, the script asks GitHub for the latest commit on the default branch and skips the repository if that commit was already scanned. It hands the rest to Codex Security's bulk-scan in the container, writes everything under ~/security/results/runs/<time>/, and emails you a summary that lists only findings no earlier night has reported. Its settings are at the top:

Setting Default
MODEL gpt-5.6-terra any OpenAI model the LLM integration serves
EFFORT medium low, medium, high or xhigh
MAX_COST 5 estimated USD limit per repository
MAX_TOTAL_COST 20 estimated USD limit per night
WORKERS 2 repositories scanned at once
EMAIL yes email the owner a summary

To change one, add it to ~/security/scan.env, for example echo EFFORT=high >> ~/security/scan.env, rather than editing the script.

Run it every night#

On the VM:

sudo tee /etc/systemd/system/codex-security-scan.service >/dev/null <<EOF
[Unit]
Description=Nightly Codex Security scan
Wants=network-online.target
After=network-online.target docker.service

[Service]
Type=oneshot
User=$USER
ExecStart=$HOME/security/nightly-scan.sh
TimeoutStartSec=8h
EOF
sudo tee /etc/systemd/system/codex-security-scan.timer >/dev/null <<'EOF'
[Unit]
Description=Run the Codex Security scan every night

[Timer]
OnCalendar=*-*-* 03:00:00 UTC
RandomizedDelaySec=30m
Persistent=true

[Install]
WantedBy=timers.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now codex-security-scan.timer

Check the setup#

On the VM:

systemctl list-timers codex-security-scan.timer --no-pager
sudo systemctl start codex-security-scan.service
journalctl -u codex-security-scan.service -n 5 --no-pager -o cat

The timer shows its next run, and with no repositories yet the scan ends with Nothing to scan.

Choose the repositories#

The scanner reads your repositories through exe.dev's GitHub integration, which holds the GitHub credentials at exe.dev's edge. Link your GitHub account once on the Integrations page, then, on your computer, add a read-only integration for each repository and attach it to the VM:

ssh exe.dev integrations add github --name=scan-api --repository=you/api --readonly --attach vm:my-codex-security
ssh exe.dev integrations add github --name=scan-web --repository=you/web --readonly --attach vm:my-codex-security

On the VM, add the same repositories to the list, and check that each answers with a commit:

cd ~/security
echo you/api >> repos.txt
echo you/web >> repos.txt
git ls-remote https://github.int.exe.xyz/you/api.git HEAD

Then run the first scan now rather than waiting for the night, and follow it:

sudo systemctl start --no-block codex-security-scan.service
journalctl -u codex-security-scan.service -f -o cat

A scan prints started and completed for each repository, then a summary like this one, which also arrives by email:

Codex Security run 2026-11-15T0242: 2 repositories, about $0.81, 1 new findings.

pallets/itsdangerous: completed ($0.34)
pallets/markupsafe: completed ($0.46)

New findings:
[medium] pallets/markupsafe src/markupsafe/_speedups.c:83
    A large attacker-controlled string can overflow the C escape output allocation
    /home/exedev/security/results/runs/2026-11-15T0242/artifacts/pallets__markupsafe/attempt-1/report.md

A small library takes 1 to 3 minutes; a large application can take an hour. Ctrl-C stops following, not the scan.

Read the results#

Each night's run has its own directory, ~/security/results/runs/<time>/:

  • summary.txt, the summary from the email.
  • results.jsonl, one line per repository with its status, revision, and estimated cost.
  • artifacts/<owner>__<repo>/attempt-1/report.md, the report: each finding with its severity, the code path from input to sink, why it matters, and a suggested fix.
  • findings.json next to it, the same findings as data, with locations, CWE numbers and fingerprints.
  • threatmodel.md, what Codex Security decided the repository's attack surface is. Worth reading once; a wrong threat model explains odd findings.

To read a report from your computer:

ssh my-codex-security.exe.xyz cat security/results/runs/2026-11-15T0242/artifacts/you__api/attempt-1/report.md

The script remembers each finding's fingerprint in ~/security/results/seen-findings.txt and reports a finding once. Delete that file to hear about everything again.

Use your own account#

The LLM integration bills model use to your exe.dev account. To use an OpenAI API key instead, keep the key off the VM with an HTTP proxy integration for https://api.openai.com, and change base_url in ~/security/state/review.config.toml to the integration's address. Agent secrets explains the pattern.

Codex Security can also sign in with ChatGPT and use your plan's Codex allowance. That suits scans you start by hand; a sign-in on a server can expire, though, and a nightly job won't tell you until it fails.

What it costs#

The VM is an ordinary exe.dev VM on your plan. The model is billed per token through the LLM integration. What we measured with gpt-5.6-terra at medium effort:

Repository Time Cost
A 20-line Flask app with two injections 1.5 to 2 minutes $0.27 to $0.44
itsdangerous (1,200 lines of Python) 1.5 minutes $0.34
markupsafe (Python and C) 3 minutes $0.46

Cost grows with the repository and with effort: Codex Security's own default, gpt-5.6-sol at xhigh, looks harder and costs several times as much. The script's limits stop a repository at about $5 and a night at about $20; requests in flight can go a little over. A night with no new commits costs nothing.

Back up and restore#

On your computer:

ssh my-codex-security.exe.xyz 'tar -czf - security/repos.txt security/scan.env security/results/runs security/results/seen-findings.txt security/results/last-scanned 2>/dev/null' > codex-security-results.tgz

Restore by unpacking it into the home directory of a VM set up with this page: ssh my-codex-security.exe.xyz tar -xzf - < codex-security-results.tgz.

Update#

The image is pinned to the version this page was tested with. To move to a newer release, check its release notes, then name the image in scan.env and pull it:

cd ~/security
echo CODEX_SECURITY_IMAGE=ghcr.io/openai/codex-security:0.11.0 >> scan.env
CODEX_SECURITY_IMAGE=ghcr.io/openai/codex-security:0.11.0 docker compose pull codex-security

Clean up#

On your computer:

ssh exe.dev rm my-codex-security
ssh exe.dev integrations remove scan-api
ssh exe.dev integrations remove scan-web

Troubleshooting#

  • can't read https://github.int.exe.xyz/... in the log: the repository has no GitHub integration attached to this VM. Check with curl -s https://reflection.int.exe.xyz/integrations, and add it as in Choose the repositories.
  • A repository's status is failed: journalctl -u codex-security-scan -n 100 shows why, and the attempt's directory under artifacts/ has the logs. The script remembers only completed scans, so the next run tries that repository again.
  • A large repository stops at its cost limit: raise MAX_COST in scan.env, or scan part of it; Codex Security's bulk scan docs describe per-repository scopes.
  • No email: the summary is in summary.txt either way. The email gateway only sends to you, and is rate-limited.
  • The timer didn't run: systemctl list-timers codex-security-scan.timer shows the last and next run; a VM that was stopped at 03:00 runs the missed scan when it starts.

Frequently asked questions#

How much does a scan cost?

The VM is part of your exe.dev plan; the model is the cost, billed to your exe.dev account through the LLM integration. In our tests, with gpt-5.6-terra at medium effort, small libraries cost $0.34 to $0.46 a scan and took 1.5 to 3 minutes. Large applications cost more, which is why the script stops a repository at about $5 and a night at about $20, and skips repositories with no new commits. See What it costs.

Can I use my ChatGPT subscription instead?

Codex Security can sign in with ChatGPT and count scans against your plan's Codex allowance, but for a scan that runs unattended every night an API key or the LLM integration is the better fit. See Use your own account.

How is it different from CodeQL or Semgrep?

Those match rules against code. Codex Security has a model read the repository: it writes a threat model, follows data from an input to a dangerous call, and checks each candidate before reporting it, so it finds logic and authorization problems that rules miss, at a price per scan. They work well together.

Does it change my code or open pull requests?

Not in this setup. The GitHub integrations are read-only, and the script only writes reports on the VM. Codex Security can draft patches, but that's a separate command this page doesn't use.

Can it scan code I don't trust?

Use a sealed VM for that, not this one, which can read your repositories. The Open Code Review page sets up a review box you copy for each review, cut off from the internet; installing the Codex Security CLI there works the same way.

Updated Nov 16, 2026 · tested end to end Nov 16, 2026 · Markdown · manifest.json · Something wrong? Tell us