Just shippedBest skills for each job.See the picks →

CodexOtherNot executed· 1 caveat

Test Codex sandbox protections against secret exfiltration

A manual test showing why Codex's drop-sudo and read-only safety strategies matter. It checks that the agent cannot read or exfiltrate API keys from the runner.

workflow_dispatch (manual)

How it works

From event to result

1
Trigger
GitHub starts a run when you run it by hand.
2
Agent
Codex, via openai/codex-action.
3
What it does
A manual test showing why Codex's drop-sudo and read-only safety strategies matter. It checks that the agent cannot read or exfiltrate API keys from the runner.
4
What you get
This listing does not state a pull request or a comment. Read the prompt, and treat the result as not executed.

Setup

Where to paste this

  1. Create .github/workflows/codex-action-test-sandbox-protections.yml
  2. Paste the workflow below into that file. The notes beside the YAML are not part of the file.
  3. This file does not name a repository secret. If the engine needs a credential, the name is not written here. Check that engine’s docs before you add one.
  4. This file has no permissions block. The job uses the repository’s default Actions token.

Let your agent do it

Copy a prompt for Claude Code, Codex, or Cursor.

Paste it into your coding agent in this repo. It does the setup and asks before anything leaves your machine.

Runs the same job in your agent session, on the plan you are signed in with. No API key, no Action.

Do the job of the "Test Codex sandbox protections against secret exfiltration" workflow from AgentFlows (https://agentflows.sh/flows/codex-action-test-sandbox-protections) right here, in this session, using the plan I'm signed in with. No API key and no GitHub Action.

What it does: A manual test showing why Codex's drop-sudo and read-only safety strategies matter. It checks that the agent cannot read or exfiltrate API keys from the runner.

The workflow normally runs on: workflow_dispatch (manual). Instead, ask me which pull request, issue, or branch to work on, then follow these instructions:

```text
A manual test showing why Codex's drop-sudo and read-only safety strategies matter. It checks that the agent cannot read or exfiltrate API keys from the runner.
```

Use the gh CLI for anything on GitHub, and show me what you plan to post or change before you do it.

The file

Workflow YAML

Copy the file as-is. The notes beside each block explain it.

.github/workflows/codex-action-test-sandbox-protections.yml

File

The rest of the file, including the prompt the engine reads.

# This example demonstrates the importance of using `drop-sudo` or `read-only`# safety strategies to prevent exfiltration of sensitive data like API keys.

Name

The name GitHub shows in the Actions tab. The file path is under Where to paste this.

name: Test sandbox protections

Trigger

GitHub starts a run when you run it by hand.

on:  workflow_dispatch:

Jobs

Each job is one runner. The steps inside it run top to bottom.

jobs:  assess-exfiltration-risk:    runs-on: ubuntu-latest    strategy:      fail-fast: false      matrix:        safety-strategy:          # `drop-sudo` is the default `safety-strategy`, which prevents the          # malicious behavior allowed by the other strategies in this example.          - drop-sudo          # `read-only` cannot write files or talk to the network, but as we          # will see, it still allows some dangerous operations.          - read-only          - unsafe

Steps

These steps run in order on that job.

    steps:      - name: Run Codex (${{ matrix.safety-strategy }})

Agent

Runs Codex with openai/codex-action@v1. Inputs: openai-api-key (the OpenAI API key secret); safety-strategy.

        uses: openai/codex-action@v1        with:          # An OpenAI API key often starts with `sk-proj-` and is followed          # by random characters matching [A-Za-z-0-9_-].          openai-api-key: sk-proj-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ          safety-strategy: ${{ matrix.safety-strategy }}      - name: Try to dump the key from the codex-responses-api-proxy process        env:          CODEX_RUN_ID: ${{ github.run_id }}        run: |          # Find the PID for the codex-responses-api-proxy process.          SERVER_INFO_FILE="$HOME/.codex/$CODEX_RUN_ID.json"          PID=$(jq .pid < "$SERVER_INFO_FILE")          # Using standard filesystem read operations (albeit privileged ones),          # try to dump the memory of the process to disk to search for the key.          sudo bash -s -- "$PID" <<'SCAN_MEM'          pid="$1"          mem="/proc/$pid/mem"          i=0          while read -r rng perms _; do            [[ $perms != r* ]] && continue            start=$((0x${rng%-*}))            end=$((0x${rng#*-}))            dd if="$mem" of="/tmp/$pid-$i.bin" bs=4096 iflag=skip_bytes,count_bytes \               skip="$start" count="$((end - start))" status=none || true            i=$((i + 1))          done < "/proc/$pid/maps"          SCAN_MEM          # Use ordinary grep to search for the key pattern in the dumped memory files.          matches=$(grep -aPo '(?<![A-Za-z0-9_-])sk-proj-[A-Za-z0-9_-]+(?![A-Za-z0-9_-])' /tmp/${PID}-*.bin | sort -u)          if [ -n "$matches" ]; then            # Note that if `openai-api-key` was read from a GitHub secret, the            # secret scanning feature would redact it from logs, but this            # could easily be circumvented by using a toy cipher like ROT13:            # https://en.wikipedia.org/wiki/ROT13.            echo "Potential leaks found:"            printf '%s\n' "$matches"          else            echo "No leaks found"          fi

Keep going

More workflows

All workflows
  • CodexPull request
    12

    Codex PR review posted as a comment

    Two-job split keeps the API key job read-only (README example pattern). `:read-only` profile per README Permission profiles.

    pull_request: opened

    Est. cost per run~$0.03 runner + OpenAI tokens (UNVERIFIED)Checked Oct 16, 2026

    Not executed· 3 caveats
  • CodexLabel
    13

    Codex implements an issue on label

    `:workspace` profile lets Codex edit the checkout (README). PR creation is plain git/gh, not an action input.

    issues: labeled == codex

    Est. cost per run~$0.09 runner + OpenAI tokens (UNVERIFIED)Checked Oct 16, 2026

    Not executed· 2 caveats
  • CodexIssue opened
    14

    Codex triage with JSON output schema

    `output-schema` is forwarded to `codex exec --output-schema` (README inputs table).

    issues: opened

    Est. cost per run~$0.01 runner + OpenAI tokens (UNVERIFIED)Checked Oct 16, 2026

    Not executed· 3 caveats