Repository Analysis

anthropics/defending-code-reference-harness

Skills for threat modeling, scanning, triage, patching, plus an autonomous scanning harness you can /customize

37.5 Strong AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of anthropics/defending-code-reference-harness, a Python project with 6,468 GitHub stars. SynthScan v2.0 examined 15,201 lines of code across 94 source files, recording 336 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 37.5 places this repository in the Strong AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

37.5
Adjusted Score
37.5
Raw Score
100%
Time Factor
2026-07-13
Last Push
6.5K
Stars
Python
Language
15.2K
Lines of Code
94
Files
336
Pattern Hits
2026-07-14
Scan Date
0.06
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 6MEDIUM 86LOW 244

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 336 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators80 hits · 261 pts
SeverityFileLineSnippetContext
MEDIUMtargets/canary/entry.c17// ─── Parser A: heap-buffer-overflow ──────────────────────────────────────────COMMENT
MEDIUMtargets/canary/entry.c33// ─── Parser B: stack-buffer-overflow ─────────────────────────────────────────COMMENT
MEDIUMtargets/canary/entry.c45// ─── Parser C: heap-use-after-free ───────────────────────────────────────────COMMENT
MEDIUMtargets/canary/entry.c65// ─── Dispatch ────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_dedup.py13# ── _signature ───────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_dedup.py60# ── dedup (results tree walk) ────────────────────────────────────────────────STRING
MEDIUMtests/test_dedup.py188# ── format_report ────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_judge.py11# ── judge output parsing ─────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_judge.py50# ── judge prompt building ────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_judge.py91# ── compare prompt building ──────────────────────────────────────────────────COMMENT
MEDIUMtests/test_judge.py105# ── manifest round-trip ──────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_patch_grade.py19# ── fixtures ─────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_patch_grade.py49# ── PatchVerdict semantics ───────────────────────────────────────────────────COMMENT
MEDIUMtests/test_patch_grade.py130# ── T1 oracle ────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_patch_grade.py149# ── ladder short-circuit (mocked docker) ─────────────────────────────────────COMMENT
MEDIUMtests/test_auth.py200# ── warn_bedrock_model ──────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_auth.py257# ── required_egress_hosts ───────────────────────────────────────────────────COMMENT
MEDIUMtests/test_auth.py275# ── check_egress_satisfied ──────────────────────────────────────────────────COMMENT
MEDIUMtests/test_auth.py43# ── resolve_auth_env ────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_auth.py157# ── usage marker ────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_xml_parse.py11# ── parse_xml_tag ────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_xml_parse.py50# ── _blocks_to_text ──────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_xml_parse.py70# ── find_tagged_message: THE BUGFIX ──────────────────────────────────────────COMMENT
MEDIUMtests/test_report.py14# ── grader tag parsing ───────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_report.py76# ── crash_file_from_frame ────────────────────────────────────────────────────STRING
MEDIUMtests/test_report.py85# ── prompt building ──────────────────────────────────────────────────────────STRING
MEDIUMtests/test_report.py130# ── representative picker ────────────────────────────────────────────────────STRING
MEDIUMtests/test_found_bugs.py12# ── asan.top_frame / project_frames ──────────────────────────────────────────COMMENT
MEDIUMtests/test_found_bugs.py156# ── jsonl append/read round-trip (raw ASAN excerpt format) ───────────────────STRING
MEDIUMtests/test_found_bugs.py230# ── concurrent-agents prompt section ─────────────────────────────────────────STRING
MEDIUMtests/test_skill_checkpoint.py33# ── happy path ───────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_skill_checkpoint.py96# ── input hardening ──────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_skill_checkpoint.py115# ── path confinement ─────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_focus.py8# ── build_find_prompt conditional sections ───────────────────────────────────COMMENT
MEDIUMtests/test_focus.py89# ── _assigned_focus round-robin ──────────────────────────────────────────────COMMENT
MEDIUMtests/test_asan.py11# ── crash_reason ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_asan.py101# ── asan_excerpt ─────────────────────────────────────────────────────────────STRING
MEDIUMtests/test_asan.py132# ── result.json integration ──────────────────────────────────────────────────STRING
MEDIUMtests/test_untrusted.py35# ── helpers ──────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_untrusted.py51# ── patch prompt ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_untrusted.py86# ── report prompt ────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_untrusted.py103# ── judge prompt ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_checkpoint.py19# ── run --resume ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_checkpoint.py57# ── --resume --stream: judge_log idempotence key ─────────────────────────────COMMENT
MEDIUMtests/test_checkpoint.py84# ── --resume layout guard ────────────────────────────────────────────────────COMMENT
MEDIUMtests/test_checkpoint.py115# ── report (skip-on-exists) ──────────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py98 # ── T0: apply + build ────────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py146 # ── T1: PoC stops ────────────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py168 # ── T2: regression suite ─────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py186 # ── re-attack ────────────────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py222 # ── T3: style (advisory) ─────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py241# ── tier oracles ─────────────────────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py271# ── T3 style judge (advisory) ────────────────────────────────────────────────COMMENT
MEDIUMharness/patch_grade.py294# ── helpers ──────────────────────────────────────────────────────────────────COMMENT
MEDIUMharness/cli.py640 # ── Build (once, shared by all runs) ──────────────────────────────────────────COMMENT
MEDIUMharness/cli.py655 # ── Focus areas (optional auto-discover via recon) ───────────────────────────COMMENT
MEDIUMharness/cli.py233 # ── Find ─────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMharness/cli.py305 # ── Grade ────────────────────────────────────────────────────────────────────COMMENT
MEDIUMharness/cli.py348 # ── Streaming: judge → report dispatch ───────────────────────────────────────COMMENT
MEDIUMharness/cli.py547# ── found_bugs.jsonl: runtime bug-sharing ───────────────────────────────────────COMMENT
20 more matches not shown…
Hyper-Verbose Identifiers181 hits · 201 pts
SeverityFileLineSnippetContext
LOWtests/test_dedup.py39def test_signature_skips_interceptor():STRING
LOWtests/test_dedup.py50def test_signature_no_frame_fallback():STRING
LOWtests/test_dedup.py55def test_signature_missing_fields():STRING
LOWtests/test_dedup.py105def test_dedup_groups_duplicates(tmp_path):CODE
LOWtests/test_dedup.py117def test_dedup_includes_rejected(tmp_path):CODE
LOWtests/test_dedup.py126def test_dedup_parses_operation(tmp_path):CODE
LOWtests/test_dedup.py139def test_dedup_signature_prefers_parsed_type(tmp_path):CODE
LOWtests/test_dedup.py149def test_dedup_skips_null_crash(tmp_path):CODE
LOWtests/test_dedup.py158def test_dedup_walks_nested_batches(tmp_path):CODE
LOWtests/test_dedup.py172def test_dedup_skips_malformed_json(tmp_path):CODE
LOWtests/test_dedup.py190def test_format_report_sorted_by_count(tmp_path):CODE
LOWtests/test_dedup.py205def test_format_report_shows_operation(tmp_path):CODE
LOWtests/test_dedup.py212def test_format_report_shows_relative_paths(tmp_path):CODE
LOWtests/test_dedup.py220def test_format_report_shows_status(tmp_path):CODE
LOWtests/test_judge.py20def test_parse_judge_dup_skip():CODE
LOWtests/test_judge.py26def test_parse_judge_dup_better():CODE
LOWtests/test_judge.py32def test_parse_judge_dup_without_bug_id_falls_open():CODE
LOWtests/test_judge.py39def test_parse_judge_unparseable_falls_open():CODE
LOWtests/test_judge.py45def test_parse_judge_case_insensitive():CODE
LOWtests/test_judge.py59def test_judge_prompt_empty_manifest():CODE
LOWtests/test_judge.py73def test_judge_prompt_with_manifest():CODE
LOWtests/test_judge.py93def test_compare_prompt_has_both():CODE
LOWtests/test_judge.py113def test_manifest_append_and_read(tmp_path):CODE
LOWtests/test_judge.py127def test_manifest_picks_up_landed_report(tmp_path):CODE
LOWtests/test_patch_grade.py52def test_verdict_passed_all_true():CODE
LOWtests/test_patch_grade.py91def test_verdict_failed_on_reattack():CODE
LOWtests/test_patch_grade.py202def test_multi_diff_reland_collapses(mock_docker):CODE
LOWtests/test_patch_grade.py280def test_reattack_clean_when_no_crash(mock_docker):CODE
LOWtests/test_patch_grade.py296def test_reattack_dirty_when_same_signature(mock_docker):CODE
LOWtests/test_patch_grade.py322def test_reattack_any_crash_fails(mock_docker):CODE
LOWtests/test_patch_grade.py347def test_no_build_command_raises():CODE
LOWtests/test_auth.py109def test_bedrock_missing_region_returns_none(monkeypatch, capsys):CODE
LOWtests/test_auth.py116def test_bedrock_invalid_region_returns_none(monkeypatch, capsys):CODE
LOWtests/test_auth.py124def test_bedrock_no_creds_returns_none(monkeypatch, capsys):CODE
LOWtests/test_auth.py190def test_marker_replaces_ambient_headers(monkeypatch):CODE
LOWtests/test_auth.py202def test_warn_bedrock_model_bare_id_warns(monkeypatch, capsys):CODE
LOWtests/test_auth.py211def test_warn_bedrock_model_prefixed_id_silent(monkeypatch, capsys):CODE
LOWtests/test_auth.py217def test_warn_bedrock_model_arn_silent(monkeypatch, capsys):CODE
LOWtests/test_auth.py225def test_warn_bedrock_model_off_bedrock_silent(capsys):CODE
LOWtests/test_auth.py230def test_warn_bedrock_model_none_or_empty_silent(monkeypatch, capsys):CODE
LOWtests/test_auth.py237def test_warn_bedrock_model_example_apac(monkeypatch, capsys):CODE
LOWtests/test_auth.py244def test_warn_bedrock_model_example_eu(monkeypatch, capsys):CODE
LOWtests/test_auth.py251def test_warn_bedrock_model_example_defaults_us(monkeypatch, capsys):CODE
LOWtests/test_auth.py263def test_required_egress_hosts_bedrock(monkeypatch):CODE
LOWtests/test_auth.py269def test_required_egress_hosts_vertex_exits(monkeypatch):CODE
LOWtests/test_auth.py277def test_check_egress_satisfied_ok():CODE
LOWtests/test_auth.py281def test_check_egress_satisfied_missing_exits(monkeypatch):CODE
LOWtests/test_auth.py288def test_check_egress_satisfied_wildcard_covers(monkeypatch):CODE
LOWtests/test_auth.py294def test_no_auth_msg_lists_all_modes():CODE
LOWtests/test_auth.py59def test_precedence_api_key_over_oauth(monkeypatch):CODE
LOWtests/test_auth.py98def test_bedrock_forwards_small_fast_model(monkeypatch):CODE
LOWtests/test_auth.py136def test_precedence_bedrock_over_api_key(monkeypatch):CODE
LOWtests/test_auth.py176def test_marker_identical_on_oauth(monkeypatch):CODE
LOWtests/test_xml_parse.py22def test_parse_multiline_content():CODE
LOWtests/test_xml_parse.py39def test_parse_strips_whitespace():CODE
LOWtests/test_xml_parse.py44def test_parse_tag_with_special_regex_chars():CODE
LOWtests/test_xml_parse.py52def test_blocks_to_text_extracts_textblocks():CODE
LOWtests/test_xml_parse.py61def test_blocks_to_text_string_passthrough():CODE
LOWtests/test_xml_parse.py65def test_blocks_to_text_empty():CODE
LOWtests/test_xml_parse.py81def test_find_tagged_message_tags_in_last():CODE
121 more matches not shown…
Unused Imports28 hits · 28 pts
SeverityFileLineSnippetContext
LOWtests/test_patch_grade.py9CODE
LOWtests/test_patch_grade_e2e.py14CODE
LOWtests/test_patch.py5CODE
LOWtests/test_sandbox.py9CODE
LOWtests/test_untrusted.py5CODE
LOWtests/test_agent_sandbox.py12CODE
LOW.claude/skills/_lib/checkpoint.py28CODE
LOWharness/patch.py11CODE
LOWharness/config.py12CODE
LOWharness/agent_image.py12CODE
LOWharness/docker_ops.py9CODE
LOWharness/patch_grade.py17CODE
LOWharness/asan.py7CODE
LOWharness/sandbox.py13CODE
LOWharness/cli.py30CODE
LOWharness/dedup.py16CODE
LOWharness/judge.py9CODE
LOWharness/agent.py22CODE
LOWharness/find.py7CODE
LOWharness/artifacts.py7CODE
LOWharness/novelty.py12CODE
LOWharness/report.py13CODE
LOWharness/grade.py11CODE
LOWharness/recon.py11CODE
LOWharness/prompts/untrusted.py12CODE
LOWharness/prompts/system_prompt.py16CODE
LOWharness/prompts/patch_prompt.py8CODE
LOWscripts/egress_proxy.py15CODE
Cross-Language Confusion5 hits · 22 pts
SeverityFileLineSnippetContext
HIGHtests/test_dedup.py31ASSERTION_OUTPUT = "entry: /work/decoder.h:4521: decode_chunk: Assertion `n >= 1 && n <= 4' failed.\n"STRING
HIGHtests/test_asan.py44entry: /work/img.h:1761: convert_format: Assertion `n >= 1 && n <= 4' failed.CODE
HIGHharness/patch.py89 f"({ignore}git init -q && git add -A && "CODE
HIGHharness/prompts/find_prompt.py68- SEGV at a non-null, attacker-influenced address (not 0x0 or 0x8)CODE
HIGHharness/prompts/find_prompt.py190- SEGV at a non-null, attacker-influenced addressCODE
Excessive Try-Catch Wrapping16 hits · 16 pts
SeverityFileLineSnippetContext
MEDIUMharness/cli.py999def _cmd_recon(args) -> int:CODE
LOWharness/cli.py645 except Exception as e:CODE
LOWharness/cli.py247 except Exception as e:CODE
LOWharness/cli.py316 except Exception as e:CODE
LOWharness/cli.py355 except Exception:CODE
LOWharness/cli.py498 except Exception as e:CODE
LOWharness/cli.py735 except Exception:CODE
LOWharness/cli.py772 except Exception as e:CODE
LOWharness/cli.py934 except Exception as e:CODE
LOWharness/cli.py1003 except Exception as e:CODE
LOWharness/cli.py1022 except Exception as e:CODE
LOWharness/cli.py1128 except Exception as e:CODE
LOWharness/cli.py1221 except Exception as e:CODE
LOWharness/cli.py1349 except Exception as e:CODE
LOWharness/agent.py339 except Exception as e:CODE
LOWscripts/setup_sandbox.sh188except Exception:CODE
AI Slop Vocabulary4 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMharness/prompts/report_prompt.py64### 2. `<reachability>` — real attack surface or harness artifact?COMMENT
MEDIUMscripts/egress_proxy.py35 # Keep in sync with harness/auth.py:_host_allowedCOMMENT
MEDIUMscripts/setup_sandbox.sh93# the default from harness.auth so Bedrock/Vertex get the right host without aCOMMENT
MEDIUMscripts/setup_sandbox.sh94# manual override. Needs the venv (harness package) — ensure it now.COMMENT
Over-Commented Block9 hits · 8 pts
SeverityFileLineSnippetContext
LOWtargets/htslib/entry.c1// Copyright 2026 Anthropic PBCCOMMENT
LOWtargets/canary/entry.c1// Copyright 2026 Anthropic PBCCOMMENT
LOWtargets/drlibs/entry.c1// Copyright 2026 Anthropic PBCCOMMENT
LOWtargets/alsa/entry.c1// Copyright 2026 Anthropic PBCCOMMENT
LOWtests/__init__.py1# Copyright 2026 Anthropic PBCCOMMENT
LOWharness/__init__.py1# Copyright 2026 Anthropic PBCCOMMENT
LOWharness/cli.py1# Copyright 2026 Anthropic PBCCOMMENT
LOWharness/prompts/__init__.py1# Copyright 2026 Anthropic PBCCOMMENT
LOWscripts/setup_sandbox.sh121COMMENT
Deep Nesting7 hits · 6 pts
SeverityFileLineSnippetContext
LOWharness/patch_grade.py37CODE
LOWharness/asan.py86CODE
LOWharness/cli.py631CODE
LOWharness/agent.py87CODE
LOWharness/agent.py113CODE
LOWharness/agent.py198CODE
LOWscripts/egress_proxy.py64CODE
AI Response Leakage1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHdocs/blog-post.md78**Refer to the [harness README.md](https://github.com/anthropics/defending-code-reference-harness/tree/main/harness) forCODE
AI Structural Patterns4 hits · 4 pts
SeverityFileLineSnippetContext
LOWharness/patch.py30CODE
LOWharness/patch_grade.py37CODE
LOWharness/find.py21CODE
LOWharness/report.py37CODE
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMdocs/blog-post.md187* [Claude Security](https://www.anthropic.com/product/security): Anthropic’s managed product for agentic vulnerability dCOMMENT