Authorized Security Testing with Claude Code and Codex A developer's writeup describes how security firm Calif reported that OpenAI's Codex found Java4Shell, a critical memory-corruption flaw in OpenJDK's x86-64 HotSpot Base64 decoder, within an hour at a token cost under $200, prompting CISA to urge immediate patching. The piece argues that coding agents now perform serious vulnerability research on dependencies, and recommends fencing such work with written scope in AGENTS.md or CLAUDE.md, sandboxed execution with network allowlists, manual verification of findings, and responsible disclosure rather than rewording prompts to bypass safety classifiers. This article was first published on Medium. The canonical URL is https://medium.com/@r3dtuxedo/authorized-security-testing-with-claude-code-and-codex-bfb7ccd49448 https://medium.com/@r3dtuxedo/authorized-security-testing-with-claude-code-and-codex-bfb7ccd49448 . Draw the fence first. Then let the agent work inside it. TL;DR - Coding agents now find real bugs. Calif says Codex found Java4Shell, a critical OpenJDK flaw, within an hour. If you run Java, patch first box below . Then fence your own agent work properly. - Agents refuse security work for a few boring reasons. A classifier read something alarming in the context your prompt, a loaded skill, a file . The request sounded offensive when the task was defensive. Or a sandbox quietly blocked the network and it looked like a stall. - The honest fix is context, not tricks. Write down whose system it is, what's in scope, what the output is, and when to stop. Put it in AGENTS.md or CLAUDE.md and ask for the concrete task. If the work really needs dual-use capability, apply for Anthropic's Cyber Verification Program or OpenAI's Daybreak instead of rewording. - The paperwork protects you, and the sandbox protects everyone else. Scope it in writing, run the agent in a sandbox or container with a network allowlist, keep findings local when they're sensitive, check every finding by hand, and disclose responsibly. A free scope template is linked below. On 17 November, the security firm Calif published Java4Shell https://calif.io/java4shell/ , a critical memory-corruption bug in the Base64 decoder of OpenJDK's x86-64 HotSpot JVM. CISA urged organizations to patch it immediately https://www.cisa.gov/news-events/alerts/2026/11/17/critical-java-vulnerability-requires-immediate-patching . The part that matters for this article is how it was found. Calif says a researcher asked Codex to audit Netty and the JVM for highly reachable bugs, and that Codex found this one within an hour. Calif puts the total token cost at less than $200. Hold that thought. It means a coding agent can now do serious vulnerability research on code you depend on, and it will do the same on yours. It also explains why the vendors fence this kind of work so carefully. If you run Java, do this first. Update to the November OpenJDK release. OpenJDK's advisory of 17 November https://openjdk.org/groups/vulnerability/advisories/2026-11-17 lists CVE-2026-114938 a HotSpot compiler flaw, CVSS 3.1 score 8.1 as affecting JDK 17, 21, 25 and 27, and says the affected builds are 27.0.1.0.3, 25.0.5.0.3, 21.0.13.0.3, 17.0.21.0.3 and earlier. Calif rates it 9.2 under CVSS 4.0 and says it affects x86-64 machines with AVX-512 support. Calif's interim mitigations are the JVM flags -XX:-UseBASE64Intrinsics or -XX:UseAVX=2 x86-64 only; on ARM the second flag stops the JVM from starting . CISA's alert also asks you to look for Java bundled inside other products and container images. Back in October, two threads in r/ClaudeCode asked a smaller version of the same question from different sides. In the first https://www.reddit.com/r/ClaudeCode/comments/1xdgyyy/ , the Claude chat app refused a scraping task that Claude Code then did without complaint. In the second https://www.reddit.com/r/ClaudeCode/comments/1xdfxg6/ , Claude refused to help read a crash dump. The poster had a reverse-engineering skill loaded at the time. One reply guessed the skill itself tripped the safety classifiers, and said a plain debugging prompt worked. Both stories are about legitimate work hitting a wall. Neither poster was doing anything wrong. And both found that the wall moved when the context changed. That's the subject of this follow-up. In part 1 https://medium.com/@r3dtuxedo/php2shell-patch-today-then-find-the-php-you-forgot-dd590977c842 , I used a coding agent to find every PHP version across my repos and open patch PRs. That's the easy end of security work: reading your own code and config. This article is about the next step. You test your own systems on purpose, with an agent, and you do it in a way that you, the vendor's safety systems and a lawyer would all be comfortable with. One rule runs through all of it: only test systems you own or have written permission to test. Everything below assumes that. The goal isn't to get past the safety checks. It's to give them, and yourself, an honest picture of the work. There's no single "safety switch". When a security task goes sideways, it's usually one of four things. Four common reasons a security task stops. Only the first three are about the model. 1. A classifier read something in context. Anthropic's help article on model fallbacks says its classifiers check your request and also what the model reads: memory, connectors, search results and files. So "content you didn't type" can trigger a fallback. Its listed cyber triggers are exploit generation, binary-based vulnerability scanning and penetration testing. When one fires, Opus 5 and 5.5 fall back to Opus 4.8. The same article says secure coding and scanning source code for vulnerabilities still work. That explains the crash-dump thread. A loaded skill full of reverse-engineering language is context too. 2. The wording sounded offensive. Scale AI studied 2,390 real conversations from a collegiate cyber defense competition. Prompts with offensive-sounding terms were refused 2.72 times as often 30.5% against 11.2% . System hardening was refused 43.8% of the time, even though it is purely defensive. Log analysis was never refused. The paper doesn't name the models, so take the numbers as a pattern rather than a scorecard. 3. Just saying "I'm authorized" didn't help. In the same study, prompts that explicitly claimed authorization were refused more often, 21.8% against 11.6%. My reading: a bare claim costs nothing to type, so it carries no weight, and the phrasing often goes with riskier requests. What helps is detail about the actual task. 4. It wasn't a refusal at all. A sandboxed command that can't reach the network fails, and from the outside that can look like the agent getting stuck. Codex's sandbox starts with network access off. Claude Code's sandbox starts with an empty list of allowed domains. In Codex, GPT-6 Astra also runs safety monitoring that can pause a task. When something "stalls", read the last tool result before you assume the model said no. The thread replies that suggested rewording around the filters, renaming skills or inventing a backstory are not advice I'll repeat. Apart from being dishonest, they don't make the work any safer, and both vendors say grants can be narrowed or withdrawn. What does work is plain context. A legitimate request has things a malicious one usually lacks: an owner, a target list, a defensive output and a stop condition. Write those down once, where the agent reads them every session. AGENTS.md is the portable place, and Claude Code users can point CLAUDE.md at it: Security work in this repo - Owner: Example GmbH. Written authorization "php-audit-2026-11", valid 2 to 13 Nov. - In scope: this repo at tag v4.2, and the lab host lab.example.internal only. - Out of scope: production, third-party services, anything not listed. - Goal: find and fix vulnerabilities in our own code. Output: findings file, line, impact, fix and patches with tests. - If a task needs anything outside this list, stop and ask. Don't work around a block. Then ask for the concrete task, not the category. "Do a pentest" is vague and sounds offensive. "Review upload.php for path traversal and missing size checks, and write a failing test for each finding" is specific, defensive, and produces something you can check. Three habits help more than any wording: If the work genuinely needs more, such as malware analysis, exploit validation or authorized penetration testing, that's what the verification programs are for. Rewording until it goes through isn't. If your work genuinely needs dual-use capability, apply for it. Don't reword your way to it. Both vendors now run programs for verified security work. I checked the official pages again on 28 November 2026. Anthropic's page still carries its 6 October update date. OpenAI's Daybreak page had been updated two days earlier, and one change matters: its newest models sit behind Red. Names and tiers change often, so check again before you apply. | | Anthropic: Cyber Verification Program | OpenAI: Daybreak Trusted Access for Cyber | |---|---|---| | Tiers | Defense, Red Team, Specialized | Blue, Red plus standard access | | Individuals | Can apply, Defense tier only | Can apply, Blue tier only | | What it changes | Adjusted safeguards on Mythos, Opus and Sonnet models, by tier | Blue: fewer refusals on some mainline models. Red: reduced refusals on the newest Astra, GPT-6.2 Sol plus cyber models such as GPT-5.6 Cyber | | How to apply | Verification Portal → Programs → Cyber Verification Program | chatgpt.com/cyber individuals ; org form for teams | | What you need | Identity verification, a description of your security work, an attestation to the tier's security controls | 18+, eligible paid plan, Advanced Account Security with a physical FIDO2 key, identity verification | | After approval | Usage Policy still applies in full; grants can be narrowed or withdrawn | Off until enabled; in Codex CLI use /daybreak or daybreak = true ; some refusals remain | | Data | Individuals: traffic retained and monitored, no Zero Data Retention | Zero Data Retention not included | | Scope | Your own code, products and infrastructure; customer work needs separate approval | Systems you own or are explicitly authorized to test; no customer-facing use | Anthropic's Cyber Verification Program CVP was expanded on 6 October to three tiers. Its help page says general models can still be used by everyone for "secure code review, threat modeling, patching known issues, finding vulnerabilities in your own source code, and triaging security alerts". Work like malware analysis or exploit validation "may be interrupted". Independent researchers, maintainers and bug bounty hunters apply as individuals, and "Individuals can apply only for Defense Access." Red Team access, which adds authorized penetration testing, is for organizations. The page now lists review targets: two days for Defense Access and two weeks for Red Team Access, with a note that reviews are currently slower because of high demand. The models covered start at Claude Mythos 5.2, Mythos 5.1, Opus 5.5 and Sonnet 5.5. One correction to a comment in the crash-dump thread: someone believed CVP requires open-source contributions or CVEs. The official page lists maintainers and researchers as examples of who can apply, but I found no CVE requirement. It asks for a description of your work and identity verification. The security requirements page is worth reading before you apply. Every tier needs a security contact, incident reporting and personal not shared access. Defense needs MFA now and phishing-resistant MFA a FIDO2 key, passkey or PIV by 15 December 2026. For individuals, traffic is retained and monitored, with no Zero Data Retention. How much does it change? Anthropic's own evaluation in the announcement says that without CVP every task was blocked at the first prompt. With Defense access, 46 of 50 tasks were still blocked. With Red Team access, none were blocked and 34 of 50 were completed. That's the vendor's own benchmark, but it shows that Defense isn't a free pass. It covers defensive work, as the name says. OpenAI's Daybreak is the name OpenAI uses for its Trusted Access for Cyber program. Daybreak Blue gives reduced refusals on supported mainline models for "verified defensive work in authorized environments" and is "the recommended starting point". Daybreak Red adds cyber-specialized models GPT-5.6 Cyber for all Red organizations, GPT-6 Cyber with separate approval and is for approved business and enterprise organizations only. Individuals apply for Blue. One catch to know about. On OpenAI's current table, Blue gives reduced refusals on older mainline models such as GPT-5.5, GPT-5.6 Sol, GPT-6 Sol and GPT-6 Luna, but GPT-6.2 Astra and GPT-6.2 Sol get reduced refusals only with Red. With Blue alone you get standard safeguards on those two. The old GPT-5.5-Cyber is now for existing customers only, and its API preview model is due to be removed on 1 February 2027. The individual setup is strict: an eligible paid plan, Advanced Account Security, at least one physical FIDO2 key a synced passkey doesn't count and identity verification. Two details catch people. First, "approval alone does not turn on reduced refusals." In Codex CLI 0.163.0 or later, type /daybreak in a session, or for headless runs: codex exec -c daybreak=true "Review src/upload for path traversal; write failing tests for each finding" Second, the refusal message tells you which case you're in: "Daybreak is currently off. If you're doing authorized security work, turn it on and try your request again." If you still see a cyber safety message with Daybreak on, OpenAI asks you to contact Support with the message, model, timestamp and request ID. Neither program authorizes you to test anything. They change what the model will help with. Permission still comes from the system's owner. OpenAI's recommended configuration for cyber work has a sentence I'd put on the wall: "Documentation alone doesn't enforce them." It lists what to document before the model starts: approved targets, excluded systems, approved tools, approved and prohibited actions, time window, data handling, disclosure, and stop conditions. That list is also a good authorization letter. I turned it into a one-page template with three parts: the signed authorization, the AGENTS.md block, and a one-line-per-session run log: https://gist.github.com/br4vesirrobin/41c1287d3c8d89b9acd844453d9b86e0 https://gist.github.com/br4vesirrobin/41c1287d3c8d89b9acd844453d9b86e0 If you test your own side project, the owner is you, and the letter feels silly. Write it anyway. Half its value is making you decide what's out of scope before the agent finds something interesting at 1 a.m. For client work, the signature matters, and the template isn't legal advice. The paperwork says what's allowed. The sandbox makes the rest hard to do by accident. I covered the general defaults in What Can Your Agent Actually Touch? https://medium.com/@r3dtuxedo/what-can-your-agent-actually-touch-6010c17243d9 . Here is the security-testing version. The whole loop. The agent works in the middle three boxes. You own the first and the last. Claude Code. The sandbox is off by default. Turn it on with /sandbox , or per run: claude --settings '{"sandbox": {"enabled": true, "allowUnsandboxedCommands": false}}' allowUnsandboxedCommands: false turns off the retry outside the sandbox. The /sandbox menu calls it Strict sandbox mode . Add failIfUnavailable: true so Claude Code refuses to start if the sandbox can't, instead of quietly running without it. Put only your lab host in network.allowedDomains . Know the edges too: built-in tools like Read and WebFetch follow permission rules, not the sandbox, and local MCP servers run with your full access. Anthropic's security docs recommend VMs or dev containers when you work with untrusted content. Codex. The sandbox is on, with network off, by default. OpenAI's cyber configuration builds a dedicated permission profile on top of that. This is their example, trimmed: approval policy = "on-request" approvals reviewer = "auto review" default permissions = "cyber-lab" features network proxy = true permissions.cyber-lab extends = ":workspace" permissions.cyber-lab.filesystem.":workspace roots" " /.env " = "deny" " / .pem" = "deny" permissions.cyber-lab.network enabled = true permissions.cyber-lab.network.domains "lab.example.com" = "allow" The important line is network proxy = true . Per the docs, without it network.enabled = true "permits direct network access" and the lab allowlist doesn't restrict anything. The docs also say to avoid :danger-full-access and --yolo for this work, and to add a command rule so curl goes to review even when the target is allowed. | Goal | Claude Code | Codex | |---|---|---| | Sandbox on | /sandbox or sandbox.enabled: true off by default | On by default | | No silent fallback | failIfUnavailable: true , allowUnsandboxedCommands: false | Don't use :danger-full-access or --yolo | | Only the lab host | network.allowedDomains , optionally strictAllowlist | Permission profile domains plus network proxy = true | | Keep secrets out | sandbox.credentials deny or mask; no keys in env | Deny /.env , / .pem ; no keys in env | | Outside the sandbox | Read/WebFetch tools, MCP servers, hooks | Web search, MCP servers, connectors, browser | Both vendors say the same thing in different words: run risky work in a separate lab. A throwaway container or VM with only the target and the tools beats a well-configured agent on your daily laptop. Start fresh for each engagement, keep the logs outside it, and delete it when you're done. Findings are sensitive. A list of unpatched bugs in a client's app is exactly what you don't want in someone else's logs. Note that CVP for individuals means traffic is retained and monitored, and Daybreak doesn't include Zero Data Retention. That's reasonable for the vendors. It might not be acceptable for your client. For the parts of the work that don't need a frontier model, run an open-weight model locally. Ollama's FAQ says "we don't see your prompts or data when you run locally". It binds to 127.0.0.1:11434 by default. Both agents can use it: ollama launch claude or ollama launch codex , or codex --oss -m