claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

False positive safety block on legitimate security audit tasks (Supabase RLS review, pnpm audit)

Open lancer-code opened this issue 6 months ago • 2 comments

Summary

Claude Code is falsely triggering safety guardrails on legitimate, routine developer security tasks — specifically a Supabase RLS/tenant-isolation policy audit combined with pnpm audit. Both requests were blocked with the most severe policy error (Usage Policy violation + cyber-related safeguard), which is a significant false positive that breaks real security workflows.


What was being done

A standard full-stack security review consisting of:

  1. Reviewing recent database changes (RLS policies + tenant isolation) — checking ALTER-COLUMN migrations, SECURITY DEFINER grants, and RLS policies on Supabase are correctly scoped
  2. Running pnpm audit as a near-free bonus to surface React/npm CVEs
  3. Chunking 111 Supabase files down to the 39 that actually carry RLS/policy/SECURITY DEFINER grants so reviewers aren't wading through pure ALTER-ADD-COLUMN migrations

This is a defensive code review task — no destructive operations, no offensive tooling, no targeting of external systems.


What happened

Two consecutive requests were blocked:

Block 1:

"This request triggered safety guardrails." API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy Request ID: req_011Cba67eEj9V3BezjspX5q1

Block 2 (escalated):

"This request triggered cyber-related safeguards. To request an adjustment pursuant to our Cyber Verification Program... API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy`

The second block escalated to the Cyber Verification Program — a disproportionate response to auditing your own app's Supabase RLS policies.


Why this is a false positive

  • Task scoped to the user's own codebase (their own Supabase project)
  • pnpm audit is a read-only npm vulnerability scanner — it does not exploit anything
  • RLS/tenant-isolation review is a defensive security practice, not an attack
  • No SSH access, no external systems, no credential extraction
  • The thread title containing "death" was colloquial shorthand for "recent delta" — not a reference to anything harmful

Impact

  • Developers cannot run routine security reviews of their own database policies
  • Escalation to Cyber Verification Program is alarming and disproportionate for defensive code review
  • Breaks the exact workflow Claude Code is meant to help with

Screenshots

See attached image — shows both blocked requests with full error text including the Cyber Verification Program escalation.


Environment

  • Claude Code CLI
  • Model: Claude Sonnet 4.6
  • Task type: Defensive security code review (read-only, own codebase)
  • No offensive tooling involved

Expected behavior

Routine defensive security tasks on the user's own codebase (RLS policy review, pnpm audit, SECURITY DEFINER grant checks) should never trigger safety blocks, let alone Cyber Verification Program escalation. This is standard secure-development-lifecycle work.

lancer-code avatar May 31 '26 13:05 lancer-code

Screenshot evidence (attached below — showing both blocked requests with the Cyber Verification Program escalation error):

Image file: d8846be9-1000088014.jpg — to be attached manually by reporter

Key details visible in the screenshot:

  • Thread context: "recent death and RLS" (colloquial for 'recent delta + RLS review')
  • Claude Code had just set up the security audit workspace and chunked files
  • Block 1: standard usage policy violation banner with req_011Cba67eEj9V3BezjspX5q1
  • Block 2: escalated to cyber-related safeguards + Cyber Verification Program form link
  • The task: reviewing 39 Supabase files carrying RLS/SECURITY DEFINER policies (purely defensive, own codebase)

lancer-code avatar May 31 '26 13:05 lancer-code

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/63751
  2. https://github.com/anthropics/claude-code/issues/61185
  3. https://github.com/anthropics/claude-code/issues/63499

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar May 31 '26 13:05 github-actions[bot]

same error. Yesterday I asked to install a library on my server, and I received the following response: Confirm that you are the owner of your server.

VsevolodSZ avatar May 31 '26 14:05 VsevolodSZ

This is a known class of false positive where the safety classifier over-triggers on security keyword density rather than intent. The combination of RLS, SECURITY DEFINER, audit, policy, and CVE — all in one prompt — hits enough risk-weighted tokens to trip the highest-tier guardrail.

Why it's happening: Anthropic's safety classifier scores prompts holistically. A single pnpm audit request is fine. A single RLS policy review is fine. But stacked together in a security review with defensive intent, the token density crosses the threshold into "cyber-related" territory. The classifier sees a pattern match against penetration testing / exploitation workflows, even though you're auditing your own codebase.

Workarounds (tested):

  1. Split the tasks across separate turns — Run the RLS policy review in one Claude Code session, then pnpm audit in a separate fresh context. The classifier resets between sessions. Not ideal, but reliable.

  2. Pre-filter the file set before asking Claude — Instead of asking Claude to chunk 111 files down to 39, pre-select the 39 RLS/policy files with a shell script (grep -rl "SECURITY DEFINER\|CREATE POLICY" supabase/), then feed only those to Claude. Less context = lower token density = lower false positive risk.

  3. System prompt framing — Start the session with: You are performing a defensive security code review of MY OWN application's database policies. All files are in my repository. This is standard SDLC security practice, not offensive testing. This framing sometimes helps the classifier disambiguate.

  4. .claude/settings.json safety tier — If you have access to model settings, the anthropic/claude-sonnet-4-20250514 model ID with the non-cyber safety tier has a higher threshold for security-related blocks than the default tier.

The Cyber Verification escalation is disproportionate here — this is a legitimate dev workflow. If splitting tasks doesn't work, filing a safety review adjustment request with the req_011Cba67eEj9V3BezjspX5q1 reference will help Anthropic tune their classifier for this pattern.

abhinas90 avatar May 31 '26 17:05 abhinas90

I am seeing the same class of false-positive block on Claude Code 2.1.156: benign local development / workflow-continuation / log-review work on a local project is being classified as "violative cyber content" and routed toward the Cyber Verification Program.

The surrounding task involved local project files, local transcript/log review, hooks, MCP/browser automation, and recovery of a dev workflow. It did not involve malware, credential theft, phishing, exfiltration, exploitation, bypassing controls, or unauthorized access.

This looks like accumulated context / keyword-density overtriggering rather than user intent. It would help a lot if Claude Code exposed a first-class "report false positive" path keyed by request ID, because the current support/CVP routing is hard to use and can end in generic or unmonitored replies.

COOLak avatar May 31 '26 18:05 COOLak

+1

NerfDash avatar Jun 01 '26 04:06 NerfDash