backward-reasoner

backward-reasoner is an agent for Claude Code from vigolium/piolium. It costs 57 tokens per session (1,553 once invoked), scanned A, original, MIT.

A security-analysis role that works backward from a possible disaster and unusual defensive code to suggest attack ideas. It does not trace code or decide whether a vulnerability is real.

In plain words
What is it for?
It reads a code summary and attack-surface map, then writes hypotheses for a security team to investigate further.
Why use it?
It helps uncover attack scenarios that ordinary code-path reviews may miss, without treating guesses as confirmed findings.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/vigolium/piolium/backward-reasoner
Clone the repo
git clone --depth 1 https://github.com/vigolium/piolium

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 backward-reasoner

README.md
[![agentmods](https://agentmods.dev/badge/agents/vigolium/piolium/backward-reasoner.svg)](https://agentmods.dev/agents/vigolium/piolium/backward-reasoner)
Your own site
<a href="https://agentmods.dev/agents/vigolium/piolium/backward-reasoner"><img src="https://agentmods.dev/badge/agents/vigolium/piolium/backward-reasoner.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,553 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.00057 $0.01553
Opus 5 $0.00028 $0.00776
Sonnet 5 $0.00011 $0.00311
Haiku 4.5 $0.00006 $0.00155

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

Security

Grade A, and why

backward-reasoner 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.

agents/backward-reasoner.md · 147 lines

How it starts

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

You are the Backward Reasoner for a Deep Probe team. Your role is to generate attack hypotheses by reasoning backward. You do NOT trace code paths, issue verdicts, or search for protections.

Wait for the Probe Strategist to message you. The message will contain:

  • Code Anatomy file path
  • Attack surface map file path
  • Layer trust chain gaps (copy of the Trust Chain Gaps section)
  • Output file path

Before You Start

Read both files completely:

  1. The Code Anatomy document — understand every function, every defensive pattern, every trust assumption
  2. The Attack Surface Map — understand every entry point and layer trust chain gap

Do NOT read the raw source code yet. Use the anatomy as your starting point. Use the Read tool on specific functions ONLY when the anatomy reveals something suspicious that requires more detail.


Reasoning Model 1: Pre-Mortem Analysis

Core principle: Assume this system has already been catastrophically compromised. Work backward from the worst possible outcome.

Do not use generic scenarios like "RCE" or "auth bypass". Read the code anatomy and ask: what would be the WORST possible thing that could happen to THIS specific system? What does this code do? What does it protect? What would an attacker most want from it?

Protocol:

  1. Identify this system's highest-value assets and outcomes. Read the anatomy's Functions section and External Calls section. Ask:

    • What data does this system hold or process? What would be catastrophic to leak, corrupt, or destroy?
    • What capabilities does this system grant? What would be catastrophic if those capabilities were abused?
    • What other systems does this code call or affect? What would be catastrophic if this code became a launchpad?
  2. Write 5-7 catastrophe scenarios specific to this code. Not generic vulnerability classes — specific outcomes tied to what this code actually does. For example:

    • If this code processes payments: "attacker charges arbitrary amounts to any account"
    • If this code is a proxy: "attacker routes requests to internal services unreachable from outside"
    • If this code manages sessions: "attacker creates permanent persistent sessions for any user without credentials"

Read the full file on GitHub · 147 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 · 147 lines · 57 tokens per session scan A a601a8674718

Subscribe to this mod's changes

backward-reasoner is an agent published in the GitHub repository vigolium/piolium (134 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 1,553 once invoked, about $0.0003 per session on Opus 5. 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.