skills/cryptoeconomic-protocol-security/SKILL.md
Analyze bonded agent systems, escrow workflows, slashing rules, oracle trust, Sybil cost, and front-running risk in protocols where agents post bonds or stake reputation. Use for collateral sizing, griefing analysis, dispute design, and bonded-agent security reviews. NOT for smart contract auditing, DeFi tokenomics, blockchain consensus design, or trading strategy.
npx skillsauth add curiositech/windags-skills cryptoeconomic-protocol-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Stress-test any system where agents post bonds, escrow funds, or stake reputation. The goal is to find the cheapest way to profit by breaking the rules -- then design defenses that make cheating more expensive than cooperating.
Every bonded agent system is vulnerable to exactly these five categories of attack. If your defense does not address all five, you have an unexamined risk.
What: The bond amount is too low relative to the damage a defecting agent can cause. Rational agents defect whenever `profit_from_defection
bond_amount + reputation_cost`.
Detection checklist:
Decision tree -- choose your defense:
Is bond_amount >= max_possible_damage?
YES --> Structural defense (full collateralization). Expensive but safe.
NO --> Can you cap max_possible_damage?
YES --> Structural: scope-limit the agent's authority.
NO --> Is reputation loss > (profit - bond)?
YES --> Social defense (reputation is the real bond).
NO --> VULNERABLE. Raise the bond or accept the risk.
Defenses:
What: An attacker posts bond, claims work, then works as slowly as possible (or not at all), tying up resources and blocking legitimate agents. The attacker may not even want profit -- the goal is to impose costs on others.
Detection checklist:
Decision tree -- choose your defense:
Does the protocol have mandatory progress checkpoints?
YES --> Is the checkpoint verified by someone other than the agent?
YES --> Economic defense (slash bond on missed checkpoint).
NO --> VULNERABLE to self-certified fake progress.
NO --> Is there a hard timeout with automatic bond forfeiture?
YES --> Economic defense (time-based). Check: is timeout
short enough to limit damage?
NO --> VULNERABLE. Add timeouts or checkpoints.
Can one agent claim multiple tasks?
YES --> Is there a concurrency cap?
YES --> Acceptable if cap is low enough.
NO --> VULNERABLE to resource exhaustion griefing.
NO --> Structural defense (single-claim limit).
Defenses:
What: Someone must decide whether acceptance criteria are met. Whoever holds that power can be bribed, coerced, or can collude with one party. "Who watches the watchers?"
Detection checklist:
Decision tree -- choose your defense:
Is acceptance determined by a single party?
YES --> Can that party profit from a dishonest ruling?
YES --> VULNERABLE. Add dispute resolution or quorum.
NO --> Weak defense (honest-but-curious assumption).
Acceptable only for low-value tasks.
NO --> Is the quorum selected randomly from a pool?
YES --> Is the pool large enough that bribing a majority
costs more than the stake?
YES --> Economic defense (cost-of-corruption).
NO --> VULNERABLE. Increase pool or stake.
NO --> Is the quorum self-selected or fixed?
--> VULNERABLE to cartel formation.
Is there an appeal/escalation mechanism?
YES --> Good. Does appeal have a higher bond requirement?
YES --> Economic defense (costly appeals filter noise).
NO --> VULNERABLE to appeal spam.
NO --> VULNERABLE. No recourse for honest agents.
Defenses:
What: An attacker creates many disposable identities to game the system. The question is not "can they?" but "what does it cost, and what do they gain?"
Detection checklist:
Decision tree -- choose your defense:
Cost to create 100 identities:
> 100x the value extractable per identity?
YES --> Economic defense (Sybils are unprofitable). Document this.
NO --> Is identity creation gated by scarce resource?
YES --> What resource?
Bond --> Economic defense if bond > extractable value.
Invitation --> Social defense (web of trust).
Proof-of-work --> Structural defense (computational cost).
KYC --> Structural but has privacy tradeoffs.
NO --> VULNERABLE. Add identity cost or cap per-identity value.
Do Sybils gain superlinear advantage?
(e.g., 10 identities get more than 10x what 1 gets)
YES --> CRITICAL VULNERABILITY. Redesign incentive curve.
NO --> Linear Sybils are manageable with per-identity costs.
Defenses:
What: An attacker reads a competitor's public intent (manifest, bid, plan) and acts on that information before the competitor can execute. In agent systems, this often means reading a published task specification and either underbidding, copying the approach, or blocking resources the competitor needs.
Detection checklist:
Decision tree -- choose your defense:
Is the plan/manifest visible before execution?
YES --> Can a competitor profit by reading it?
YES --> Is there a commit-reveal scheme?
YES --> Structural defense. Verify the reveal
phase cannot be skipped or delayed.
NO --> VULNERABLE. Add commit-reveal or
sealed-bid mechanism.
NO --> Low risk. Document why visibility is harmless.
NO --> Structural defense (private plans). But verify:
Can metadata (timing, resource claims) leak intent?
YES --> Partial vulnerability. Assess metadata leakage.
NO --> Strong defense.
Time window between publication and execution:
Near-zero (atomic commit-and-execute)?
--> Structural defense (no window to exploit).
Nonzero?
--> Window is the attack surface. Minimize it.
Defenses:
For any identified attack vector, classify the defense:
ATTACK VECTOR IDENTIFIED
|
v
Can you make the attack structurally impossible?
(walls, cryptography, access control, protocol rules)
YES --> STRUCTURAL DEFENSE
Examples: scope limits, commit-reveal, concurrency caps,
quorum oracles, sealed bids
Strength: Strongest. Does not depend on rational actors.
NO |
v
Can you make the attack economically unprofitable?
(bonds, slashing, dynamic pricing, costly identity)
YES --> ECONOMIC DEFENSE
Examples: bond > damage, checkpoint slashing, per-identity
bond, costly appeals, front-running penalties
Strength: Strong against rational actors. Fails against
irrational griefers or state-level attackers.
NO |
v
Can you make the attack socially costly?
(reputation, trust networks, public history)
YES --> SOCIAL DEFENSE
Examples: reputation multiplier, invitation chains,
oracle reputation, priority queuing
Strength: Weakest standalone. Best as complement to
structural or economic defenses.
NO |
v
ACCEPTED RISK
Document it. Name it. Set a review date.
Every accepted risk must have:
- A name
- An estimated likelihood and impact
- A trigger condition for re-evaluation
- An owner
An analysis is complete only when ALL of the following are true:
Every attack class examined. All five attack classes have been evaluated against the target system. No class is skipped.
Every attack vector has a named defense OR is explicitly flagged as accepted risk. There are no unaddressed vectors. "We haven't looked at this" is not acceptable. "We looked at this, the cost of defense exceeds the expected loss, and we accept the risk with review date 2026-Q3" is acceptable.
Every defense is classified. Each defense is labeled as structural, economic, or social. Mixed defenses list all types.
Economic defenses have numbers. Bond amounts, cost-of-attack estimates, and break-even calculations are present. "The bond should be higher" without a number is not a defense.
Social defenses have a degradation plan. What happens when the community is small? What happens when reputation data is sparse? Social defenses that assume a mature community must document the bootstrapping vulnerability.
Accepted risks have four fields. Name, likelihood/impact estimate, trigger for re-evaluation, and owner. Missing any field means the gate fails.
The summary table is filled. Every row has a verdict, defense type, and status.
flowchart TD
A[Incoming request for Cryptoeconomic Protocol Security] --> B{Within this skill's scope?}
B -->|No| C[Redirect using NOT-for boundaries]
B -->|Yes| D[Assess inputs, constraints, and current state]
D --> E{Which path fits best?}
E -->|Plan or design| F[Choose the simplest viable pattern]
E -->|Migration or change| G[Protect compatibility and rollout safety]
E -->|Debug or evaluate| H[Localize the failing boundary first]
F --> I[Apply the domain-specific guidance below]
G --> I
H --> I
I --> J[Validate against the quality gates]
Use this as the first-pass routing model:
Use the anti-pattern catalog below as the operational failure-mode checklist for this skill. During execution, explicitly look for these failure patterns before you ship a recommendation or implementation.
A bond that is too low is worse than no bond. It creates false confidence. Always compute bond-to-damage ratio.
Reputation is the weakest defense layer. It fails when: the community is small, identities are cheap, or the attacker has a long time horizon (build reputation, then defect once for big payoff). Never use reputation as the sole defense for high-value interactions.
If the protocol allows it and it is profitable, someone will do it. Design for the attacker who reads your source code.
Cryptoeconomic security is architectural. Retrofitting bonds and slashing onto a system designed without them creates inconsistencies that attackers exploit. Design the incentive structure first.
Over-collateralization drives away legitimate participants. If the bond exceeds expected return, only attackers with ulterior motives participate. Bond sizing is a Goldilocks problem.
No oracle is trusted. The question is not "is the oracle honest?" but "what is the cost to make the oracle dishonest, and is that cost higher than the value at stake?"
Metadata leaks. Timing, payload size, bidder identity, and resource pre-positioning all leak intent even when content is encrypted.
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.