ai-logical-bug-scan

ai-logical-bug-scan is a command for Claude Code from marcosd4h/DeepExtractRuntime. It costs 0 tokens per session (4,491 once invoked), scanned A, original, MIT.

A command that uses AI agents to look for logic-based security vulnerabilities across program code and its call paths. It checks issues such as authentication bypasses, privilege escalation, state errors, and missing impersonation cleanup.

In plain words
What is it for?
It is for scanning a module or starting function, following calls to a chosen depth, and reporting logic vulnerabilities in decompiled software.
Why use it?
It examines how functions work together and verifies suspected problems against the program's compiled instructions, reducing reliance on simple pattern matching.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: reads .claude/ paths; mentions subagents.

Not installable on its own: it runs a file from its repository that does not travel with it. Clone the repository, or install whatever ships that file. The line is python .claude/skills/ai-logic-scanner/scripts/build_threat_model.py <db_path> --json \.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-logical-bug-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcosd4h/deepextractruntime/ai-logical-bug-scan.svg)](https://agentmods.dev/commands/marcosd4h/deepextractruntime/ai-logical-bug-scan)
Your own site
<a href="https://agentmods.dev/commands/marcosd4h/deepextractruntime/ai-logical-bug-scan"><img src="https://agentmods.dev/badge/commands/marcosd4h/deepextractruntime/ai-logical-bug-scan.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,491 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.04491
Opus 5 $0.00000 $0.02246
Sonnet 5 $0.00000 $0.00898
Haiku 4.5 $0.00000 $0.00449

Measured 6d ago against content hash 08a8d3c10c5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ai-logical-bug-scan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

commands/ai-logical-bug-scan.md · 436 lines

How it starts

The opening of the file, as written. The whole thing — 436 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Logical Bug Scan

Overview

AI-driven scan for logic vulnerabilities: authentication/authorization bypass, state machine errors, confused deputy, privilege escalation, missing impersonation revert, and sensitive API parameter injection.

Uses LLM agents that navigate cross-module callgraphs, read decompiled code on demand, and verify findings against assembly ground truth. All vulnerability detection decisions are made by LLM agents, not pattern matching.

Usage:

  • /ai-logical-bug-scan <module> -- scan top entry points for the module
  • /ai-logical-bug-scan <module> <function> -- scan from a specific function
  • /ai-logical-bug-scan <module> <function> --depth 3 -- limit callgraph depth

IMPORTANT: Execution Model

This command executes immediately. Run the full pipeline and deliver the completed report without pausing for confirmation. Use the workspace handoff pattern for all phases.

Status Messaging (MANDATORY)

Keep the user informed at every phase boundary. Output a plain-text status message before each phase starts and after it completes. Messages are 1-2 lines summarizing what is happening and what the phase produced. Do NOT suppress status messages to "save time."

Execution Context

IMPORTANT: Script invocations like python .claude/skills/.../script.py run from the workspace root. The scripts manage their own path setup.

Step 0: Preflight Validation

from helpers.command_validation import validate_command_args
result = validate_command_args("ai-logical-bug-scan", {
    "module": "<user_module>",
    "function": "<user_function_or_None>",
})
if not result.ok:
    # report errors and stop
db_path = result.resolved["db_path"]

Workspace Protocol

Create .claude/workspace/<module>_logicscan_<function_or_all>_<timestamp>/ and pass --workspace-dir and --workspace-step to all skill scripts.

Subagent Compliance Checklist (MANDATORY)

Before proceeding past each phase, verify the following. Violations invalidate the scan.

Read the full file on GitHub · 436 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 436 lines · 0 tokens per session scan A 08a8d3c10c5e

Subscribe to this mod's changes

ai-logical-bug-scan is a command published in the GitHub repository marcosd4h/DeepExtractRuntime (19 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,491 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.