business-logic-and-state-abuse

business-logic-and-state-abuse is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 82 tokens per session (2,070 once invoked), scanned A, original, Apache-2.0.

A security review guide for workflows that move through states or handle money, credits, quotas, approvals, invitations, coupons, counters, or expiry. It looks for actions that can be skipped, repeated, raced, or given invalid values.

In plain words
What is it for?
Use it when changing state machines, payments, refunds, balances, limits, approvals, invite systems, coupon redemption, counters, or expiration handling.
Why use it?
Each request may look valid while a sequence of requests breaks a business rule, such as shipping an unpaid order or redeeming a coupon twice. It helps expose these logic and timing flaws, including failures that leave partial changes behind.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it when changing state machines, payments, refunds, balances, limits, approvals, invite systems, coupon redemption, counters, or expiration handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/business-logic-and-state-abuse
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.

Any agent
npx skills add makifbaysal/tasktrooper --skill business-logic-and-state-abuse
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

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 business-logic-and-state-abuse

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/business-logic-and-state-abuse/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/business-logic-and-state-abuse)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/business-logic-and-state-abuse"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/business-logic-and-state-abuse/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 business-logic-and-state-abuse

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/business-logic-and-state-abuse"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/business-logic-and-state-abuse.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,070 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.00082 $0.02070
Opus 5.5 $0.00033 $0.00828
Sonnet 5.5 $0.00016 $0.00414
Haiku 4.5 $0.00008 $0.00207

Measured 27d ago against content hash 9d443e4946d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

business-logic-and-state-abuse 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 27d 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.

catalog/agents/security-agent/skills/business-logic-and-state-abuse/SKILL.md · 118 lines

How it starts

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

Business Logic and State Abuse

Overview

Logic flaws have no dangerous-looking line: no exec, no string-built query, nothing a scanner matches. Every request in the attack is valid on its own; the vulnerability is the sequence, the timing or the number. They are also where the money is — free credits, double refunds, skipped approvals, a role nobody granted.

Core principle: name the invariant the workflow promises ("an order ships only after it is paid", "a coupon is redeemed once", "an invite cannot grant more than the inviter has"), then look for a sequence of individually valid requests that breaks it.

1. State Machines — Skipping, Reversing, Replaying (CWE-841)

// ❌ the transition never checks the current state: ship an unpaid order, refund a refunded one
func (s *Service) Ship(ctx context.Context, id string) error {
	return s.repo.SetStatus(ctx, id, StatusShipped)
}

// ✅ the precondition is part of the write; zero rows means the transition is not allowed
res, err := s.db.ExecContext(ctx,
	`UPDATE orders SET status = 'shipped' WHERE id = $1 AND org_id = $2 AND status = 'paid'`, id, orgID)
if n, _ := res.RowsAffected(); n == 0 { return ErrInvalidTransition }

Look for: a status taken from the request body; a step endpoint that does not check the previous step completed (verify-email, MFA, payment, approval, KYC); a completed flow that can be replayed (redeem, claim, confirm, accept-invite); a "cancel" that leaves the side effect (credits granted, access given) in place.

2. Check-Then-Act Races With Real Impact (CWE-362, CWE-367)

Not a "theoretical race": here the attacker sends both requests. A finding when the window is one read-then-write in a handler and the impact is money, quota, a unique claim or a privilege.

// ❌ two parallel requests both read balance=100 and both withdraw 100
const acct = await db.account.findUnique({ where: { id } });
if (acct.balance < amount) throw new Error("insufficient");
await db.account.update({ where: { id }, data: { balance: acct.balance - amount } });

// ✅ one atomic conditional write
const n = await db.$executeRaw`UPDATE account SET balance = balance - ${amount}
  WHERE id = ${id} AND balance >= ${amount}`;
if (n === 0) throw new Error("insufficient");

Read the full file on GitHub · 118 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. 27d ago First seen · 118 lines · 82 tokens per session scan A 9d443e4946d2

Subscribe to this mod's changes

business-logic-and-state-abuse is a skill published in the GitHub repository makifbaysal/tasktrooper (122 stars, last pushed yesterday), licensed Apache-2.0. It adds 82 tokens to every session and 2,070 once invoked, about $0.0003 per session on Opus 5.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-10-15.

Related

business-logic-and-state-abuse compared with skills from other repositories

business-logic-and-state-abuse next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
business-logic-and-state-abusemakifbaysal/tasktrooperSkill122yesterdayApache-2.0A82Claude Code, Codex
agent-performance-optimizerruvnet/rufloSkill81ktodayMITA19Claude Code
agent-refinementruvnet/rufloSkill81ktodayMITA15Claude Code
doca-debugNVIDIA/skillsSkill3.9kyesterdayApache-2.0A233Claude Code, Codex
doca-flowNVIDIA/skillsSkill3.9kyesterdayApache-2.0A224Claude Code, Codex
compute-sanitizer-diagnose-cuda-bugsNVIDIA/skillsSkill3.9kyesterdayApache-2.0A213Claude Code, Codex
dynamo-interconnect-checkNVIDIA/skillsSkill3.9kyesterdayApache-2.0A71Claude Code, Codex