economic

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EconomicExploitPlan

type EconomicExploitPlan struct {
	AttackID       string
	GameType       GameType
	Players        []PlayerProfile
	PayoffMatrix   [][]float64
	Strategies     []Strategy
	Iterations     int
	ExploitGoal    string
	TargetBehavior string
}

EconomicExploitPlan defines a game theory attack plan

type ExecutionResult

type ExecutionResult struct {
	Success            bool
	FinalPayoffs       map[string]float64
	EquilibriumReached bool
	ExploitAchieved    bool
	TargetManipulated  bool
	GameDynamics       *GameDynamics
	VulnerabilityFound string
}

ExecutionResult contains the results of a game theory exploit

type GameDynamics

type GameDynamics struct {
	CooperationRate   float64
	DefectionRate     float64
	StrategyEvolution []StrategySnapshot
	PayoffTrends      map[string][]float64
	NashDeviation     float64
}

GameDynamics analyzes the game evolution

type GameState

type GameState struct {
	Round         int
	PlayerActions map[string]string
	Payoffs       map[string]float64
	History       []RoundHistory
	Equilibrium   bool
}

GameState represents the current state of the game

type GameTheoryExploitEngine

type GameTheoryExploitEngine struct {
	// contains filtered or unexported fields
}

GameTheoryExploitEngine implements economic game theory attacks on LLMs

func NewGameTheoryExploitEngine

func NewGameTheoryExploitEngine(logger common.AuditLogger) *GameTheoryExploitEngine

NewGameTheoryExploitEngine creates a new instance

func (*GameTheoryExploitEngine) ExecuteGameTheoryExploit

func (e *GameTheoryExploitEngine) ExecuteGameTheoryExploit(
	ctx context.Context,
	plan *EconomicExploitPlan,
) (*ExecutionResult, error)

ExecuteGameTheoryExploit runs a game theory based attack

func (*GameTheoryExploitEngine) GenerateExploitReport

func (e *GameTheoryExploitEngine) GenerateExploitReport(
	result *ExecutionResult,
	plan *EconomicExploitPlan,
) string

GenerateExploitReport creates a detailed report

type GameType

type GameType string

GameType represents different economic game scenarios

const (
	PrisonersDilemma    GameType = "prisoners_dilemma"
	ChickenGame         GameType = "chicken_game"
	StagHunt            GameType = "stag_hunt"
	UltimatumGame       GameType = "ultimatum_game"
	PublicGoodsGame     GameType = "public_goods_game"
	AuctionTheory       GameType = "auction_theory"
	VotingParadox       GameType = "voting_paradox"
	TragedyOfCommons    GameType = "tragedy_of_commons"
	NashEquilibrium     GameType = "nash_equilibrium"
	ZeroSumManipulation GameType = "zero_sum_manipulation"
)

type PlayerProfile

type PlayerProfile struct {
	PlayerID     string
	PlayerType   string // "llm", "attacker", "environment"
	Rationality  float64
	RiskAversion float64
	Strategies   []string
}

PlayerProfile represents a player in the game

type RoundHistory

type RoundHistory struct {
	Round   int
	Actions map[string]string
	Payoffs map[string]float64
}

RoundHistory stores history of a game round

type Strategy

type Strategy struct {
	StrategyID   string
	Description  string
	PayoffFunc   func(state GameState) float64
	Conditions   []string
	Adaptiveness float64
}

Strategy represents a game strategy

type StrategySnapshot

type StrategySnapshot struct {
	Round                int
	StrategyDistribution map[string]float64
}

StrategySnapshot captures strategy distribution at a point

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL