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.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python .claude/skills/ai-logic-scanner/scripts/build_threat_model.py <db_path> --json \.

Good fit It is for scanning a module or starting function, following calls to a chosen depth, and reporting logic vulnerabilities in decompiled software.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/marcosd4h/DeepExtractRuntime
agentmods
npx agentmods add commands/marcosd4h/deepextractruntime/ai-logical-bug-scan

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-logical-bug-scan

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.5 $0.00000 $0.01796
Sonnet 5.5 $0.00000 $0.00898
Haiku 4.5 $0.00000 $0.00449

Measured 3mo ago against content hash 08a8d3c10c5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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. 3mo 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 (21 stars, last pushed 2mo 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.

Related

ai-logical-bug-scan compared with commands from other repositories

ai-logical-bug-scan next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ai-logical-bug-scanmarcosd4h/DeepExtractRuntimeCommand212mo agoMITA0Claude Code
qa-changesOpenHands/extensionsCommand190todayMITA63Claude Code
auditar-cascadingluanpdd/kit-mcpCommand5yesterdayMITA54Claude Code
react-nativegetsentry/toolkitCommand977yesterdaynoneA0Claude Code
http-serviceMadAppGang/magusCommand16todayMITA27Claude Code
doctordoncheli/don-cheli-sddCommand593mo agoApache-2.0A76Claude Code
doctorfatihkan/badiCommand81mo agoMITA0Claude Code