Skip to content

When Claude Code declines security work

Claude Code declines or reroutes much offensive security work by design, and its documentation says so. For authorized testing you have two routes: ask Anthropic about its trusted access programs, or keep the agent and point it at a different model endpoint, such as a security-tuned build on PentestLLM.

shell
curl https://api.pentestllm.ai/v1/messages \
  -H "x-api-key: sk-ptl-live-…" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "auto/security",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Draft a detection rule for this log pattern and explain each condition."}]
  }'
Rows of server cabinets in a data centre

What the Claude Code docs say

Claude Code’s model configuration page, read on 11 November 2026, has a section on security research. It says workloads in offensive security, including penetration testing and Capture the Flag exercises, trigger model fallback frequently, often on the first request. It describes this as expected routing for these domains and not an account flag, and it tells organizations that need its top models for this work to ask their Anthropic account team about trusted access programs.

So if your session switches model or ends in a refusal on a pentest task, nothing is wrong with your account. The behaviour is intended.

Option one: stay with Anthropic

If your organization has an Anthropic account team, the trusted access route in the docs is the supported way to do this work on Claude models. It is the right choice when policy requires a single approved vendor. It is not self-serve, and an individual tester or a small consultancy may not have an account team to ask.

Option two: change the model endpoint

Claude Code talks to whatever Anthropic-format endpoint ANTHROPIC_BASE_URL names. PentestLLM serves the Messages format at https://api.pentestllm.ai, so two variables and a model id put a security build behind the same agent, with the same file editing, shell and planning tools.

Be clear about what this is. Anthropic’s gateway documentation says it does not support routing Claude Code to non-Claude models through any gateway. The setup works because the endpoint speaks the Messages format, but Claude-specific features such as extended thinking and prompt cache controls are dropped on the way, and you should not expect help from Anthropic with it. The Claude Code guide has the full steps and the errors you may meet.

shell
export ANTHROPIC_BASE_URL=https://api.pentestllm.ai
export ANTHROPIC_AUTH_TOKEN=sk-ptl-live-…
claude --model auto/security

Option three: a second agent for security work

Many testers keep Claude Code on Claude for ordinary development and run a separate agent for engagements. OpenCode, Cline and aider all take an OpenAI-compatible base URL directly, with no format bridge involved. Shell exports only last for the terminal they are set in, so a dedicated terminal for security sessions keeps the two setups apart. See the OpenCode guide for the config file.

What does not change

A different model does not change what you are allowed to do. PentestLLM is for systems you own or have written permission to test, and the acceptable use policy applies to every request. The security builds answer questions other models decline; they still refuse sometimes, and their output still needs a tester’s review before anything runs against a target.

9 security builds, priced per token

Read from the live catalog on 2026-11-11. Prices are US dollars per million tokens, paid from a prepaid balance that starts at $10. The id auto/security has no price of its own: each request is billed at the build that answered.

BuildInputOutput
Qwen3.8 27B Cybersecurity$0.40$2.40
Gemma 4 26B A4B Cybersecurity$0.4224$1.3376
GLM-5.3 Flash Cybersecurity$0.5093$1.6975
Red Team (Flash)$0.90$3.00
Red Team (Pro)$1.50$6.00
OrcaCyber MiniMax M3.1 Flash$2.00$4.00
OrcaCyber Qwen3.8 Flash Next$2.00$4.00
Cyber Frontier$5.25$15.75
OrcaCyber Zero 1.5$7.50$18.75

Full price list and tool fees · Every model · API docs

Questions

  • Its documentation says offensive security workloads, including penetration testing and CTF exercises, frequently trigger model fallback, and that this is expected routing for the domain. Requests that stay flagged end in a refusal.

  • The Claude Code documentation says no: it calls the fallback expected routing for these domains, not an account flag.

  • It can be pointed at any endpoint that speaks the Anthropic Messages format by setting ANTHROPIC_BASE_URL and a credential. Anthropic states that it does not support routing Claude Code to non-Claude models, so this is an unsupported setup.

  • No. Security-tuned and abliterated builds refuse far less often than general assistants on security questions, but they still decline some requests. The accurate description is reduced refusals.

  • PentestLLM is prepaid from $10 with no subscription. On 2026-11-11 the lowest-priced security build costs $0.40 per million input tokens.

Read next

Facts about other products and tools on this page were read from their own pages on 11 November 2026: Claude Code docs: model configuration, Claude Code docs: LLM gateways. They change; check the source before relying on a figure.

One key, from $10

PentestLLM is for systems you own or have written permission to test. The acceptable use policy says what is not allowed.

Get a key

usage, 1,000 agent turns on Qwen3.8 27B Cybersecurity
Input, 8,000 tokens at $0.40 per million
$0.0032
Output, 1,000 tokens at $2.40 per million
$0.0024
One turn
$0.0056
1,000 turns
$5.60
output price per million tokens, 9 builds

$1.3376 Gemma 4 26B A4B CybersecurityOrcaCyber Zero 1.5 $18.75