Attacks¶
Attack primitives used by the Terrarium attack framework.
- class terrarium.attacks.reference.AgentPoisoningAttack(client, name, model_name, max_conversation_steps, tool_logger, trajectory_logger, environment_name, poison_payload, generation_params=None)[source]¶
Bases:
BaseAgentReplaces any outgoing blackboard posts with a fixed poisoning payload.
Initialize an Agent.
- Parameters:
client – LLM client instance
name – Agent name
model_name – Model name (provider-specific)
max_conversation_steps – Max conversation turns for multi-step tool execution (default: 3)
tool_logger – Logger for tool call tracking
trajectory_logger – Logger for agent reasoning trajectories
environment_name – Environment name (prefer passing environment.__class__.__name__)
generation_params (Optional[Dict[str, Any]]) – Generation parameters specific to the provider/model (e.g., temperature, top_p)
retrieval_enabled – Whether this agent can call recall() to search the full, uncompacted blackboard history — the retrieval-backed compaction modifier.
- class terrarium.attacks.reference.CommunicationProtocolPoisoningAttack(payload=None, attack_logger=None, attacker_label='SYSTEM', poison_payload=None)[source]¶
Bases:
objectInjects system messages into every blackboard via the communication proxy.
- class terrarium.attacks.reference.ContextOverflowAttack(client, name, model_name, max_conversation_steps, tool_logger, trajectory_logger, environment_name, poison_payload, generation_params=None)[source]¶
Bases:
BaseAgentAppends a large filler sequence to overwhelm downstream context windows.
Initialize an Agent.
- Parameters:
client – LLM client instance
name – Agent name
model_name – Model name (provider-specific)
max_conversation_steps – Max conversation turns for multi-step tool execution (default: 3)
tool_logger – Logger for tool call tracking
trajectory_logger – Logger for agent reasoning trajectories
environment_name – Environment name (prefer passing environment.__class__.__name__)
generation_params (Optional[Dict[str, Any]]) – Generation parameters specific to the provider/model (e.g., temperature, top_p)
retrieval_enabled – Whether this agent can call recall() to search the full, uncompacted blackboard history — the retrieval-backed compaction modifier.