Direct answer
A refusal during authorized security research is a routing problem, not proof that the research is illegitimate and not proof that the refusal is wrong. First record authorization, asset scope, allowed actions and evidence storage. Then reduce the task to a harmless local experiment that demonstrates the same control failure. Claude Code’s Security feature can help re-examine findings and filter false positives, but Official (F021) says that feature does not authorize every penetration test, exploit or target. If a model still declines a legitimate task, select another model whose documented terms permit the work. Do not disguise the request or teach the agent to evade safeguards. The honest loss is that the public evidence contains no refusal rate, no complete classifier policy and no guarantee that clearer wording will change the outcome.
Why refusals happen
Start by separating three events that often get collapsed into one complaint. A model can refuse a request. A permission layer can block a tool call. A hook can reject a command before execution. Those controls protect different boundaries, and a transcript that only says the task did not happen cannot tell you which one acted.
Official (F016, F021): Anthropic documents approval systems and sandboxing around prompt injection, while its Security page describes reviewing findings and removing false positives. Neither source publishes a numerical approval rate or a complete list of security-research prompts that will be accepted. A declined answer therefore needs classification before troubleshooting. Save the exact prompt, the model in use, the tool that was proposed, the approval decision and the resulting message. Redact credentials and target details before sharing that record.
A second source of ambiguity is context. Repository files, issue text and tool output can contain instructions that the agent treats as input. Independent (F016, F017): research on agentic prompt injection establishes that external content can influence tool use, and Cloud Security Alliance research examines the GitHub Action path. Authentication on an MCP server does not make its returned text trustworthy. A security task that reads attacker-controlled material needs the same containment as any other agent task.
The useful question is not, “How do I make the model ignore its rules?” It is, “Which part of this authorized task is being misclassified, and can I prove the control objective with less sensitive input?” Sometimes the answer is a smaller lab. Sometimes the right response is to stop and use a human-run test. Neither outcome is a failed engagement.
Build a two-column decision record for every proposed action. On one side, write the allowed effect from the packet. On the other, write the exact tool request. A mismatch is a stop condition, even when the command looks routine. This habit catches quiet scope expansion such as a read-only check that begins writing fixtures into a source directory or a local test that starts uploading results.
Game projects show why classification matters. A request to analyze an owned save format is not the same as a request to reproduce protected game content, and neither is automatically a security test. The game-development IP and reverse-engineering boundary provides a separate task-classification workflow. Keeping these categories distinct prevents a broad label such as “reverse engineering” from hiding the actual authorization question.
Repository instructions deserve their own review before a security session. A CLAUDE.md file, test fixture or issue comment may contain directions that conflict with the engagement packet. The repository prompt-injection guide explains how project text crosses into agent context. Treat that text as input to evaluate, not as authority to expand the test.
Refusal paths
| Path | What you can observe | Safe response | Evidence boundary |
|---|---|---|---|
| Model declines the request | A refusal or incomplete answer before a tool action | Clarify the authorized objective, reduce sensitivity, or choose a permitted model | Unknown: the classifier rule that fired |
| Permission layer blocks a tool | An approval prompt, denial or missing execution | Inspect the requested command and the active permission rule | Official: permissions are a control surface, not a bug report |
| Hook rejects a command | A hook decision or missing expected side effect | Test the hook with a harmless marker and inspect its exit handling | Official: hooks can block tool calls |
| Tool result introduces new instructions | Unexpected proposed action after external content is read | Treat the result as data, narrow permissions and re-plan | Independent: indirect prompt injection is a documented risk |
| Lab isolation fails | Test traffic reaches an unintended host or credential | Stop the run, preserve safe evidence and repair containment | Unknown: no universal failure rate is supplied |
Authorization evidence
An authorization packet should let a reviewer decide whether the test may start without reading the whole chat. Put the packet in the engagement record, then give the agent a short reference to it. Do not paste private customer documents into a prompt merely to make the task sound official. A concise scope reference plus a human approval is usually easier to audit.
Official (F021): the Security feature’s existence does not expand your authority. Document the system owner, the allowed environment, the permitted techniques, the test window, the stop conditions and the person who can approve an exception. If any field is missing, the correct next action is to ask the engagement owner, not to infer permission from repository access.
Treat credentials as part of scope. A lab account that can read production data is not a harmless test account. A token that can delete cloud resources is not made safe by a prompt that says not to delete them. Official (F011, F015): install commands are executable actions, and checkpointing does not cover every shell side effect. Write the credential boundary into the packet before the first command runs.
Authorization packet
| Field | What to record | Reject the run when |
|---|---|---|
| Owner and approver | Named person or role with authority over the target | Approval is assumed from access alone |
| Asset scope | Hosts, repositories, accounts and data classes included | The target list includes an ambiguous production system |
| Allowed actions | Read-only checks, local reproduction, controlled validation | The request requires an undisclosed destructive action |
| Test window | Start, end and blackout periods | The engagement has no agreed window |
| Data handling | Storage location, redaction rules and deletion owner | Evidence would be copied into a public transcript |
| Stop conditions | Unexpected access, data exposure, service impact | No one can halt the test promptly |
| Model and tool route | Selected model, agent and connected servers | The route’s terms or permissions are unreviewed |
Lab scope
A good lab proves a narrow control failure without depending on a live victim. Use disposable local files, synthetic records and a target you own. Name the expected marker before execution. For example, a test of whether a file-read permission is too broad can use a harmless text file containing the word LAB_MARKER, not a real secret. The test passes only if the permitted reader can access the marker and the denied reader cannot.
That design gives you a result that another engineer can reproduce. It also gives the model a task with clear limits. Official (F008): best practices recommend naming files, describing symptoms and defining success. For security work, add the authorization reference and the forbidden action. “Analyze this local parser fixture for crash handling” is bounded. “Find a way into the customer’s service” is not.
Isolate the lab from the development repository’s normal hooks and MCP servers. Those extensions may add network access or commands that have nothing to do with the test. Official (F017, F019): MCP servers and plugins expand the agent’s tools, and plugin review should cover the exact version and permissions. The Claude Code plugin security audit explains how to inspect hooks, commands, servers and updates before a session starts.
Network containment matters as much as file containment. Official (F028): enterprise network settings include proxy variables, custom CA configuration and client certificate variables, and those variables load once at startup. That makes a clean launch important when a lab requires an allowlisted route. The Claude Code corporate proxy TLS and mTLS guide covers the configuration path. Do not disable certificate checks or firewall protection to make a test convenient.
Model selection
Choose a model for the permitted task, not for its willingness to ignore policy. Read the provider’s current terms and acceptable-use rules. Record the model identifier actually used, because a gateway label or an agent preset may not describe the upstream route precisely. The model selection guide for coding agents provides a useful evaluation framework, while the OpenAI versus Anthropic API format guide explains why an agent’s expected request format can constrain the route.
A model change is a new test condition. Keep the authorization packet, lab files and success marker unchanged, then compare the proposed action and final evidence. Do not compare two runs if one had production credentials and the other did not. Do not call a model safer because it produced a longer warning. Score the run on whether it stayed in scope, produced verifiable evidence and stopped at the agreed boundary.
Official (F009): independent review is useful because a fresh reviewer has not seen the reasoning behind the code. Apply the same principle to security findings. Ask a separate reviewer to check whether the evidence supports the claim, whether the test stayed within scope and whether the proposed fix addresses the control failure. Tell the reviewer to skip style preferences so the review does not drift into unrelated abstraction.
There is a real tradeoff here. A model that accepts more security requests may also accept more ambiguous instructions from untrusted files. Official (F016, F017): approvals, sandboxing and least privilege remain necessary regardless of model choice. A permissive model is not a containment strategy. The Claude Code harness security boundary explains why the execution environment matters alongside the model.
Use a small evaluation set when the same refusal appears across sessions. Include one clearly permitted local task, one ambiguous task that needs clarification and one task that should be refused. The goal is not to find a magic prompt. The goal is to verify that your team can distinguish those categories and that the agent stays within the packet. Keep expected decisions beside observed decisions so a reviewer can see where the process failed.
Record review time separately from model latency. A fast refusal is not a successful test, and a long accepted answer is not automatically useful evidence. Measure whether the run produced a reproducible artifact, how long a qualified reviewer needed and whether rework was required. The cost per verified change framework keeps those outcomes connected without inventing a token-saving claim.
A safe worked test
Use this test when a prompt is refused but the engagement is clearly authorized. It checks a local permission boundary, not a remote exploit.
Create a disposable directory outside the repository. Add one text file named scope-marker.txt containing LAB_MARKER. Record the file path in the packet. Configure the lab so one test identity may read that directory and another may not. Do not use production credentials or copy a real secret into the file.
Give the agent a bounded request: identify whether the permitted identity can read the marker, use only the provided local test script, do not modify other files and stop if any path falls outside the disposable directory. The expected evidence is a redacted result showing allowed access for the first identity and denied access for the second. No network target is involved.
Before execution, inspect the proposed command. Reject shell redirection that writes outside the lab, package installation, credential enumeration and any command whose effect you cannot explain. Official (F011, F015): a package install can execute lifecycle scripts, and Bash-only changes are not fully covered by Claude Code checkpoints. The rewind and checkpoint limits explain why a local safety copy still matters.
After execution, compare the marker result with the permission rules. A pass means the control behaved as specified in this lab. It does not prove the production control behaves the same way. A failure means the lab needs investigation, not that every deployment is vulnerable. Save the command, exit status, redacted output and reviewer decision. The proof-of-work packet is a useful format for keeping “done” separate from “verified.”
Keep the expected result visible during review. A reviewer should compare the observed access decision with the packet without inferring intent from the model’s explanation. If the evidence is incomplete, mark the stage incomplete and repeat the harmless test with better instrumentation. Do not fill the gap with a plausible story.
Protocol
| Stage | Required artifact | Pass condition | Stop condition |
|---|---|---|---|
| Authorize | Signed scope packet | Owner, assets and actions are explicit | Any scope field is missing |
| Prepare | Disposable lab and synthetic marker | No production data or credentials | Real secrets appear in the lab |
| Plan | Bounded prompt and allowed tools | Success and forbidden actions are named | The plan includes an unclear destructive step |
| Execute | Command record and exit status | Only approved tools run | A command escapes the lab |
| Verify | Independent review of evidence | Evidence supports the narrow claim | The result is generalized beyond the lab |
| Close | Redacted report and cleanup record | Evidence storage follows policy | Sensitive output is about to be shared |
Practical response: a refusal runbook
Run the following sequence whenever an authorized test stalls. It keeps diagnosis separate from model persuasion and gives the engagement owner a clear decision point.
- Freeze the record. Save the redacted prompt, model, tool request, permission decision and output. Do not rerun blindly against a live target.
- Classify the stop. Decide whether the model declined, a permission blocked, a hook rejected or the lab itself failed. If the evidence cannot distinguish these, mark the cause Unknown.
- Recheck authority. Compare the requested action with the signed packet. Remove anything that is out of scope rather than arguing that it is harmless.
- Reduce the experiment. Replace external targets with synthetic local fixtures. Replace broad reconnaissance with a named file and a named success condition.
- Inspect connected tools. Disable unnecessary MCP servers and plugins for the lab. Review hooks that can execute commands. The Claude Code MCP trust boundaries explain why tool output remains untrusted after authentication.
- Check permissions. Confirm that read, write and network permissions match the test. Do not answer repeated prompts by creating a broad permanent allow rule.
- Choose a permitted route. If the task is legitimate and the model still declines, use a provider whose terms permit it. Preserve the same lab and scorecard.
- Verify independently. Have a reviewer check the evidence and scope. A second model agreeing is not proof; the artifact and control behavior are the evidence.
- Close safely. Redact the report, remove synthetic credentials and follow the engagement’s evidence-retention policy.
Approval fatigue can weaken an otherwise good protocol. When a workstation prompts repeatedly, pause and inspect why the same boundary is being crossed. A narrower permission rule or a smaller task is safer than approving every request to keep the session moving. If the prompt itself is broken, troubleshoot the shell or credential path instead of treating broad access as the workaround. The macOS Keychain permissions guide and the PowerShell path quoting guide cover two platform-specific cases.
Official (F020): the settings reference exposes transcript retention and telemetry controls, but that does not mean a session has zero logging or a universal default retention period. Check the Claude Code privacy and retention rules before storing security evidence. The secrets in logs and transcripts guide covers local copies that can outlive a chat window.
Scope discipline belongs in the runbook too. Official (F008, F010): named files and success criteria are recommended, while the fact pack contains no measured scope-drift rate. The overengineering and diff scope guide helps prevent a security test from turning into an unrelated repository rewrite. If a migration is proposed as a fix, separate planning from production apply using the database migration safety workflow.
Honest loss and data gaps
The largest gap is causal. A refusal can result from the prompt, the model, the connected tools, a permission rule, a hook or an ambiguous policy boundary. The supplied public sources do not expose enough internal detail to assign a universal cause. Treat “false positive” as a reviewable judgment about a specific authorized request, not a label for every refusal. Keep the unknown label until a controlled comparison isolates the cause.
The second gap is prevalence. There is no verified refusal rate for legitimate security research in this fact pack. There is also no measured success rate after adding an authorization packet. You can show that a particular run stayed in scope and produced evidence. You cannot claim that the packet improves acceptance by a percentage without a defined evaluation set.
A third gap concerns model behavior over time. Policies and model versions can change. Keep the date, model identifier, agent version and connected tool list with the result. Re-run the harmless lab when those inputs change, but do not silently replace an old failed result with a new passing one. Preserve both and explain the changed condition.
Official (F014, F015): checkpoints cover file edits, not every Bash, subagent or external-state change. A rewind is therefore not a substitute for a disposable lab, backups or a controlled evidence store. Official (F038): the Code Review feature is read-only and has plan and organization restrictions; it does not push commits or authorize a security test. The code-review bottleneck guide is useful for planning human review capacity, not for claiming automated clearance.
Practical alternative for OpenAI-format agents
One AI API Key is an optional route when you want to compare models on the same authorized lab without treating a refusal as a reason to weaken safeguards. On 2026-11-27, the 46 live free model IDs were OpenAI-format only. The working pattern is an OpenAI-format agent such as OpenCode, Cline or Cursor, using the gateway base URL and one selected free ID. The endpoint quickstart shows the request setup.
Do not put those free IDs into Claude Code. First-party (F047, F048): Claude Code uses the Anthropic-format endpoint, and all four Claude IDs were marked unavailable on 2026-11-27. The documented compatibility route is not currently a working free-Claude route. The format compatibility notes keep that distinction visible.
The free lane shares 100 requests and 5,000,000 tokens per day per account, with a reset at 05:30 IST or 00:00 UTC. Accounts can have up to three keys, with one request in flight per key on free models. Those are shared allowances, not a security-research budget or a promise that every model will accept the task. New accounts receive $10 credit without a card, and billing is prepaid with no subscription or seat fee. Review prepaid pricing, per-key controls and the privacy and retention policy before sending lab evidence. Use the cost calculator for paid comparisons, and create an account only if the route fits your policy.
FAQ
Does a security-research refusal mean the request violated policy?
No. It means the system declined that request under conditions you may not fully observe. Check the authorization packet, classify whether the stop came from the model or a tool control, and reduce the experiment. Do not assume every refusal is a false positive, and do not assume every refusal proves a violation.
Can Claude Code Security authorize a penetration test?
No. Official (F021): the feature helps re-examine findings and filter false positives. Authorization must come from the owner of the target and the engagement’s approved scope. A product feature cannot grant permission to test someone else’s system.
Should I hide the security context to get past a refusal?
No. Disguising the task undermines the audit record and does not fix an ambiguous policy boundary. State the legitimate objective, narrow the lab, remove out-of-scope actions and choose a model whose terms permit the work. If those steps fail, stop.
What evidence makes a security result credible?
A scoped target, a reproducible command, the observed exit status, redacted output and an independent review. A confident explanation from a model is not enough. Keep the authorization reference and the limits of the lab beside the finding.
Can a checkpoint recover a destructive security test?
Only within its documented coverage. Official (F014, F015): Claude Code tracks file edits, while Bash-only changes, subagent edits and some external changes are not fully tracked. Use disposable infrastructure and separate backups for state that a rewind cannot restore.
Sources
- Anthropic’s Claude Code Security feature and false-positive review
- Anthropic’s Claude Code security model
- Anthropic’s permissions reference
- Anthropic’s hooks reference
- Cloud Security Alliance research on GitHub Action prompt injection
- Independent research on prompt injection against agentic assistants