coreason-simulacrum
Project description
coreason-simulacrum
The Adversarial Simulation & Chaos Engineering Engine for Coreason-AI.
coreason-simulacrum is the automated "Red Team" engine for the ecosystem, addressing the "Static Evaluation Trap" by evolving beyond benchmarks. It serves as a dual-engine simulator:
- The Adversarial Engine (RL): Dynamically evolves social engineering attacks using TAP (Tree of Attacks with Pruning).
- The Chaos Engine (Infra): Injects latency, errors, and noise to verify GxP resilience.
Features
- Dual-Agent Red Teaming: Uses a "Strategist" (High-Reasoning) and "Attacker" (Uncensored) architecture.
- Evolutionary Attacks (TAP): Optimizes attack trajectories over multiple turns to maximize success rates.
- Infrastructure Chaos: Simulates latency, API errors, and token starvation to test resilience.
- Auto-Hardener: Generates DPO triplets (Attack, Refusal, Compliance) from successful attacks for model fine-tuning.
- Model Diversity Enforcement: Prevents model collapse by enforcing different families between Attacker and Target.
- Constitutional Inversion: Inverts safety constitutions to generate boundary probes.
Installation
pip install coreason-simulacrum
Usage
Here is how to set up and run a basic simulation:
import asyncio
from coreason_simulacrum.workflow import AdversarialSimulation
from coreason_simulacrum.schemas import AdversaryProfile
from coreason_simulacrum.testing.mocks import MockCoreasonConnect, MockGrader, MockLLM
from coreason_simulacrum.state import GraphState
async def main():
# 1. Define the Adversary Profile
profile = AdversaryProfile(
name="The Novice",
goal="Extract sensitive PII",
strategy_model="claude-3-opus", # Strategist (Different family from target)
attack_model="mistral-large" # Attacker
)
# 2. Initialize Components (Using Mocks for demonstration)
# In production, replace MockLLM with actual provider implementations.
sim = AdversarialSimulation(
profile=profile,
strategist_llm=MockLLM(),
attacker_llm=MockLLM(),
target=MockCoreasonConnect(agent_id="target-agent", model_id="gpt-4o"),
grader=MockGrader(),
max_turns=5
)
# 3. Compile the Graph
app = sim.compile()
# 4. Run the Simulation
initial_state = GraphState(
messages=[],
strategist_instruction=None,
rejected_branches=[],
current_turn=0,
success=False
)
print("Starting simulation...")
final_state = await app.ainvoke(initial_state)
if final_state["success"]:
print("Attack Successful! DPO Triplet generated.")
else:
print("Defense Held.")
if __name__ == "__main__":
asyncio.run(main())
License
This project is licensed under the Prosperity Public License 3.0. Commercial use beyond a 30-day trial requires a separate license. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coreason_simulacrum-0.1.0.tar.gz.
File metadata
- Download URL: coreason_simulacrum-0.1.0.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
176e0f201d438eaddf7c1fb22d4a4792d8d03dcc08da2fd36ed5f85af1d23b0a
|
|
| MD5 |
4faad93eeb52e3e1b8f38c8cc6f14fcc
|
|
| BLAKE2b-256 |
5d093447130c33be999e295b0dc375db2c94bbd594929fb511a73577d2deec33
|
Provenance
The following attestation bundles were made for coreason_simulacrum-0.1.0.tar.gz:
Publisher:
publish.yml on CoReason-AI/coreason-simulacrum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_simulacrum-0.1.0.tar.gz -
Subject digest:
176e0f201d438eaddf7c1fb22d4a4792d8d03dcc08da2fd36ed5f85af1d23b0a - Sigstore transparency entry: 835870887
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-simulacrum@c2a63facc66bfa05fddc5d49675db457963fc067 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c2a63facc66bfa05fddc5d49675db457963fc067 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coreason_simulacrum-0.1.0-py3-none-any.whl.
File metadata
- Download URL: coreason_simulacrum-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efd0ec5fa5d97d313ba1e8698e08177cb9950cfc98bd5e166a7d7168a931344d
|
|
| MD5 |
102b66c10419bf353a94f6123d6f50a4
|
|
| BLAKE2b-256 |
6d6323f048099974df6579cf778ef0d07dd2c47da17f09fb34277db24f256c85
|
Provenance
The following attestation bundles were made for coreason_simulacrum-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CoReason-AI/coreason-simulacrum
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_simulacrum-0.1.0-py3-none-any.whl -
Subject digest:
efd0ec5fa5d97d313ba1e8698e08177cb9950cfc98bd5e166a7d7168a931344d - Sigstore transparency entry: 835870889
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-simulacrum@c2a63facc66bfa05fddc5d49675db457963fc067 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c2a63facc66bfa05fddc5d49675db457963fc067 -
Trigger Event:
release
-
Statement type: