Prisoners dilemma and cooperation

From fatihguner/foreman · View interactive version

Prisoners dilemma and cooperation is an AI agent skill from the GitHub repository fatihguner/foreman. Analyzes the Prisoner's Dilemma and related non-cooperative game structures that cause rational actors to produce collectively suboptimal outcomes. Covers price war dynamics via the Cournot duopoly model, the Tragedy of the Commons for shared resources, and mechanisms for escaping destructive equili

How to use this skill

Skill file

Read runtime and advisory rules before applying this skill. Other Foreman layers and the catalog are in ../../content/, relative to this SKILL.md.

Prisoner's Dilemma and Cooperation

BETRAYAL MATH. Two rational people, acting in pure self-interest, will consistently choose the option that hurts them both. This is not a paradox of human psychology -- it is a mathematical certainty. The Prisoner's Dilemma, formulated by Albert Tucker in 1950, demonstrates that individual rationality and collective rationality can be fundamentally opposed. Every price war, every race-to-the-bottom in a crowded market, every cofounder relationship that collapses into mutual suspicion follows the same structural logic. Understanding why the trap exists is the first step toward escaping it. The second step -- and the one most entrepreneurs skip -- is recognizing which structural conditions make escape possible and which make it impossible.


The Framework

The Classic Prisoner's Dilemma

Two suspects are arrested. The police separate them and offer each the same deal:

| | Suspect B: Stay Silent | Suspect B: Confess |

|--|----------------------|-------------------|

| Suspect A: Stay Silent | Both serve 1 year | A serves 10 years, B goes free |

| Suspect A: Confess | A goes free, B serves 10 years | Both serve 8 years |

The logic is merciless. If B stays silent, A is better off confessing (freedom vs. 1 year). If B confesses, A is still better off confessing (8 years vs. 10 years). Confessing is the dominant strategy for both. The Nash equilibrium is (Confess, Confess) -- both serve 8 years. Yet both would prefer (Silent, Silent) -- 1 year each. Individual rationality destroys collective benefit.

This structure is not an abstract curiosity. It is the default architecture of competition.

The Entrepreneur's Prisoner's Dilemma: Price Wars

Translate the matrix into business terms. Two competing SaaS companies serving the same market must choose between maintaining prices and cutting prices.

| | Competitor: Maintain Price | Competitor: Cut Price |

|--|--------------------------|---------------------|

| Your Startup: Maintain Price | Both earn healthy margins (profit: 500K each) | You lose customers, they gain share (you: 150K, them: 700K) |

| Your Startup: Cut Price | You gain customers, they lose share (you: 700K, them: 150K) | Both earn razor-thin margins (profit: 250K each) |

The dominant strategy for each firm is to cut prices. The equilibrium (250K, 250K) is stable but destructive. Both would prefer the cooperative outcome (500K, 500K), but neither can unilaterally choose it without risking the worst outcome (150K).

This is every price war ever fought. Not because entrepreneurs are stupid, but because the incentive structure makes cooperation individually irrational.

The Cournot Duopoly: How Price Wars Actually Work

The Prisoner's Dilemma captures the binary choice. The Cournot model captures the continuous dynamic -- how two firms producing a similar product settle into an equilibrium output level that is worse for both than the cooperative alternative.

The mechanism, stripped of mathematics: when two competitors independently decide how much to produce (or how aggressively to price), each firm's optimal output depends on what the other firm does. Each firm produces more than the cooperatively optimal level, because restricting output unilaterally means surrendering market share. The result: total industry output exceeds the level that maximizes total industry profit. Both firms earn less than they would under cooperation.

The Cournot outcome in practical terms:

| Scenario | Each Firm's Share of Maximum Possible Profit |

|----------|---------------------------------------------|

| Monopoly (one firm, full market) | 100% |

| Cooperative duopoly (two firms, coordinated) | 50% of a larger pie -- roughly 62.5% of monopoly profit each |

| Competitive duopoly (Cournot equilibrium) | Roughly 44% of monopoly profit each |

| Aggressive price war (below Cournot) | Diminishing toward zero |

The gap between cooperative and competitive outcomes is the "cost of non-cooperation." In mature markets with two or three dominant players, this cost can represent billions in forfeited profit annually. Airlines, telecom providers, and cloud infrastructure companies all live in this gap.

The Tragedy of the Commons: When Many Players Compete

The Prisoner's Dilemma involves two players. The Tragedy of the Commons, articulated by Garrett Hardin in 1968, extends the logic to many players sharing a finite resource -- and the results are worse.

The mechanism: each individual gains the full benefit of exploiting a shared resource but bears only a fraction of the cost of that exploitation. A fisherman who catches one extra fish gains the entire value of that fish but depletes the stock by an amount shared across all fishermen. The rational individual response is to maximize personal exploitation. When everyone does this, the resource collapses.

The Entrepreneurial Tragedy of the Commons:

| Shared Resource | Players | Exploitation Pattern | Collapse Symptom |

|-----------------|---------|---------------------|-----------------|

| Customer attention in a market | All startups in the space | Each startup increases marketing spend to capture attention | Customer acquisition costs rise until the market becomes unprofitable for everyone |

| Open-source ecosystem | Companies building on OSS | Each company consumes without contributing | Critical projects become undermaintained; ecosystem degrades |

| VC funding in a hot sector | All funded startups in the sector | Each company burns cash to grow faster than competitors | Sector "winter" when funding dries up; most companies die |

| Talent pool in a city | Competing employers | Each company raises salaries to attract talent | Compensation hyperinflation; profitability erodes for all |

A critical finding from the extended analysis: the more players involved, the worse the outcome. As the number of competitors increases, the equilibrium point shifts further from the collective optimum and closer to total resource depletion. Two firms in a market can sometimes sustain near-cooperative outcomes through implicit coordination. Twenty firms cannot. This is the mathematical justification for the common startup strategy of pursuing markets with few competitors: fewer players means the equilibrium is closer to the cooperative optimum.

Escaping the Dilemma: Five Structural Mechanisms

The Prisoner's Dilemma is not destiny. Specific structural conditions transform non-cooperative games into sustainable cooperation.

1. Repetition (The Shadow of the Future). In a one-shot game, defection is always rational. In a repeated game, the calculus changes. If players know they will interact again -- and the future interactions are sufficiently valuable -- cooperation becomes sustainable. The key parameter is the "shadow of the future": the present value of all future interactions relative to the immediate gain from defection. When the shadow is long (ongoing customer relationships, repeat negotiations, industry reputation), cooperation emerges. When it is short (one-time transactions, terminal negotiations, exit scenarios), defection dominates.

2. Reputation and Transparency. When actions are visible and reputations persist, defection carries a long-term cost that exceeds the short-term gain. This is why markets with high transparency (public pricing, review systems, industry gossip networks) sustain more cooperation than opaque markets. Entrepreneurs building reputation early create a cooperation-enabling asset.

3. Enforceable Contracts. The most direct escape from the dilemma: a binding agreement with penalties for defection. Non-compete clauses, exclusive distribution agreements, and minimum advertised pricing (MAP) policies all function as game-theoretic commitment devices. The contract changes the payoff matrix by adding a cost to defection.

4. Reducing the Number of Players. The commons tragedy worsens with each additional player. Consolidation, exclusive partnerships, and niche focus all reduce the effective number of players. Two firms can sustain implicit cooperation; twenty cannot. Market structure that limits the player count inherently enables better equilibria.

5. Changing the Payoff Structure. Sometimes the game itself can be redesigned. Joint ventures, revenue-sharing agreements, platform ecosystems, and industry standards all alter the payoff matrix so that cooperation becomes individually rational rather than requiring sacrifice. The most elegant solutions make defection unprofitable rather than merely discouraged.


Prompts

Prompt 1 -- Diagnose a Price War:

My company is in [describe market], and we are experiencing price compression from competitors. Help me map this as a Prisoner's Dilemma. Identify the players, their strategies, and the approximate payoffs for each combination. Then assess: is this a one-shot game or a repeated game? What is the "shadow of the future" -- how much do ongoing interactions matter? Based on the game structure, recommend whether to compete on price, differentiate to exit the game entirely, or pursue one of the five escape mechanisms (repetition, reputation, contracts, player reduction, payoff restructuring).

Prompt 2 -- Identify Tragedy of the Commons in Your Market:

My market has [number] competitors all competing for [describe shared resource: customer attention, talent, VC funding, etc.]. Help me analyze this as a Tragedy of the Commons. How far is the current equilibrium from the cooperative optimum? How does the number of competitors affect the outcome? What structural changes could move the equilibrium toward a better outcome for my company specifically -- even if the market as a whole remains competitive?

Prompt 3 -- Design a Cooperation Structure:

I want to establish cooperative dynamics with [describe: competitor, partner, cofounder, supplier]. Help me design the structural conditions for sustainable cooperation. Analyze: Is the interaction repeated or one-shot? Is the payoff transparent or opaque? Can contracts enforce cooperation? Can the number of involved parties be reduced? Present a specific mechanism design that makes cooperation individually rational for all parties.

Prompt 4 -- Evaluate Cofounder Dynamics as a Game:

My cofounder and I are facing a strategic disagreement about [describe: equity split, role division, resource allocation, pivot decision]. Map this as a two-player game. What are the strategies available to each of us? What are the payoffs for each combination? Where is the Nash equilibrium, and is it a good outcome? If not, what structural changes to our partnership (vesting schedules, decision-making protocols, third-party governance) could shift us toward a better equilibrium?


Use Cases

Early-Traction Delivery Startup Facing a Subsidy War

Three venture-backed food delivery startups operate in the same metropolitan area. Each subsidizes customer orders to capture market share -- offering discounts that exceed the actual delivery cost. The game structure is a multi-player Prisoner's Dilemma: each company's individually rational strategy is to subsidize more aggressively than competitors, but the collective result is that all three burn cash faster than necessary, training customers to expect below-cost pricing. The founder analyzes the game and recognizes two escape paths. First, she narrows geographic focus to three neighborhoods where her company has the strongest supply density, effectively reducing the game from three-player to near-monopoly in those zones. Second, she shifts the competition axis from price subsidy to delivery speed -- changing the payoff structure so that the game is no longer purely about who offers the biggest discount.

Growth-Stage B2B Company in a Feature War

Two competing project management tools for construction companies have entered a feature war -- each copying the other's features within weeks of release. The result is that neither achieves sustainable differentiation, and both spend engineering resources on features that cancel each other out rather than advancing the product category. The CTO maps this as an iterated Prisoner's Dilemma and calculates that the "shadow of the future" is long: both companies expect to compete for years, the market is transparent (features are publicly visible), and customer switching costs are moderate. She proposes an implicit cooperation strategy: instead of matching every competitor feature, focus engineering on a distinct product dimension (mobile-first vs. desktop-first) and signal this strategic direction publicly. By committing visibly to a different lane, she converts a zero-sum feature war into a differentiated market where both companies can earn healthy margins.

Scale-Stage Platform Managing Ecosystem Competition

A developer platform with 2,000 third-party applications observes a Tragedy of the Commons: developers competing for the same user attention oversaturate certain categories, degrading discovery quality for users and profitability for developers. The platform CEO applies the commons framework and implements three interventions. First, category-specific application caps that limit the number of players per niche (reducing n). Second, a revenue-sharing model that rewards quality over quantity (changing the payoff structure). Third, transparent performance metrics that make reputation visible and consequential (enabling reputation-based cooperation). Within six months, developer revenue per application increases by 40%, and user satisfaction scores in the affected categories recover.


Anti-Patterns

  1. Assuming the dilemma is inescapable. The Prisoner's Dilemma only traps players when the game is one-shot, anonymous, and structurally fixed. Most business interactions are repeated, reputation-bearing, and structurally malleable. The pessimistic reading of the dilemma -- "cooperation is impossible" -- is theoretically valid only under conditions that rarely obtain in practice. The productive question is always: which structural conditions can be changed to enable cooperation?
  1. Cooperating in a genuinely one-shot game. The reverse error is equally dangerous. When the interaction truly will not repeat -- a one-time negotiation with a party you will never encounter again, a terminal business transaction -- cooperation is not sustained by any structural mechanism. Naively cooperating in a one-shot game against a rational adversary is not noble; it is strategically incoherent. Recognize the game type before selecting the strategy.
  1. Blaming competitors for "irrational" price wars. Price wars are typically the Nash equilibrium of the game's payoff structure. Calling competitors irrational for doing what the structure incentivizes is a failure of analysis, not a competitor failure. The productive response is to change the game structure, not to lament the opponent's choices.
  1. Ignoring the number of players. The gap between the competitive equilibrium and the cooperative optimum widens with each additional player. Entrepreneurs who enter crowded markets without a plan to reduce the effective number of competitors (through niching, differentiation, or consolidation) are accepting the worst version of the commons outcome. Player count is a strategic variable, not a given.
  1. Applying the cooperation framework to genuinely zero-sum situations. The Prisoner's Dilemma produces suboptimal outcomes because the game has a cooperative surplus -- a better outcome available if players coordinate. Some competitive situations are genuinely zero-sum: one player's gain is exactly another's loss. In zero-sum games, cooperation mechanisms do not apply. Attempting to cooperate in a zero-sum game simply transfers value to the less cooperative party.

By Stage

| Stage | Focus | Key Difference |

|-------|-------|----------------|

| Validation | Identifying the game structure | Before entering a market, determine whether the competitive dynamic is a Prisoner's Dilemma, a coordination game, or something else. Markets where the dilemma structure dominates (commodity products, low switching costs, many competitors) will compress margins regardless of execution quality. Choose accordingly. |

| Early Traction | Monitoring defection signals | Track competitor pricing, feature releases, and marketing spend for signs of escalation. Early detection of a price war or feature war creates time to respond structurally rather than reactively. |

| Growth | Building cooperation infrastructure | Establish the conditions for sustainable competition: visible commitments to a distinct positioning, long-term contracts that reduce incentives to defect, reputation investments that raise the cost of aggressive moves. The shadow of the future is longest at growth stage -- leverage it. |

| Scale | Designing market rules | At scale, the company can shape the game itself through platform policies, industry standards, ecosystem design, and strategic acquisitions. The goal shifts from surviving the dilemma to redesigning the game so the dilemma does not arise. |


Output Template

# Competitive Game Analysis: Cooperation vs. Defection

**Market/Situation:** [Description]
**Company:** [Name]
**Date:** [Date]

## Game Structure Identification

- **Game type:** [Prisoner's Dilemma / Tragedy of the Commons / Coordination Game / Other]
- **Number of significant players:** [Count]
- **Repeated or one-shot:** [Assessment]
- **Shadow of the future:** [Long / Medium / Short -- explain]

## Payoff Matrix

|  | Competitor Cooperates | Competitor Defects |
|--|----------------------|-------------------|
| **We Cooperate** | Us: [payoff], Them: [payoff] | Us: [payoff], Them: [payoff] |
| **We Defect** | Us: [payoff], Them: [payoff] | Us: [payoff], Them: [payoff] |

## Equilibrium vs. Optimum

- **Nash Equilibrium (predicted outcome):** [Description and payoffs]
- **Cooperative Optimum (ideal outcome):** [Description and payoffs]
- **Cost of non-cooperation:** [Gap between the two]

## Escape Mechanism Assessment

| Mechanism | Feasible? | Implementation | Expected Impact |
|-----------|-----------|---------------|----------------|
| Repetition / Long-term interaction | [Yes/No] | [How] | [Impact] |
| Reputation / Transparency | [Yes/No] | [How] | [Impact] |
| Enforceable contracts | [Yes/No] | [How] | [Impact] |
| Reduce player count | [Yes/No] | [How] | [Impact] |
| Restructure payoffs | [Yes/No] | [How] | [Impact] |

## Recommended Strategy

1. [Primary action]
2. [Fallback if cooperation fails]
3. [Long-term structural play]

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.