Skip to main content

Forge SDK for Python

Wrap any AI agent with 12-dimension observation, 16 detectors, and 14 autonomous intervention strategies.

Installation

pip install forge-agent-sdk

Requirements: Python 3.10+ (including 3.14). Works on Windows, macOS, and Linux.

Quick Start

1. One-Line Run (Simplest)

from forge_sdk import quick_run

result = quick_run("Write a function to validate email addresses")
print(f"Success:       {result.success}")
print(f"Observations:  {result.observation_count}")
print(f"Detections:    {result.detection_count}")
print(f"Interventions: {result.intervention_count}")

2. Explore What's Available

from forge_sdk import list_presets, list_detectors, list_strategies, list_observers

print("31 Presets:  ", list_presets())
print("16 Detectors:", list_detectors())
print("14 Strategies:", list_strategies())
print("12 Observers:", list_observers())

3. Full Harness API

from forge_sdk import create_harness

# Create a harness with the "solo" preset
harness = create_harness(preset="solo")

# Run a task
result = harness.run("Build a REST API for a todo app")
print(result.to_dict())

# Dry run — observe only, no intervention
result = harness.dry_run("Test run — observe only")
print(f"Would have intervened: {result.intervention_count} times")

# Custom preset with more turns
result = harness.run_with("Add JWT authentication", preset="claude-code", turns=8)

4. Expected Output

Success:       True
Observations:  9
Detections:    0
Interventions: 0

When the harness detects an issue:

⚠  HARNESS [T6]: StaleContext detected. Context pressure 87%.
   → Strategy: Compact. Context reduced 87% → 58%. Saved 4.2K tokens.

API Reference

Functions

Function Description
quick_run(task, preset="solo", turns=4) One-shot: create harness, run task, return result
create_harness(preset="solo") Create a PyHarness instance for repeated use
list_presets() List all 31 available presets
list_detectors() List all 16 detectors
list_strategies() List all 14 intervention strategies
list_observers() List all 12 observation dimensions
get_version() Get the forge-agent-sdk version string

PyHarness Methods

Method Description
harness.run(task) Run task through full observe → detect → intervene pipeline
harness.dry_run(task) Observe and detect only (no intervention)
harness.run_with(task, preset, turns) Run with custom preset and turn count

HarnessRunResult Fields

Field Type Description
agent_id str Agent identifier
success bool Whether the task completed successfully
observation_count int Pipeline observation cycles executed
detection_count int Issues detected during the run
intervention_count int Interventions applied during the run
to_dict() dict Convert result to a Python dictionary

Presets

All 31 presets: solo, langgraph, crewai, autogen, langchain, openai-swarm, semantic-kernel, haystack, dspy, llamaindex, taskweaver, agno, atomic-agents, bee-agent, pydantic-ai, claude-code, aider, cline, continue, vercel-ai, copilot, cursor, windsurf, devin, amazon-q, replit-agent, pearai, bolt-new, lovable, v0, custom.

# Use any preset the same way
harness = create_harness(preset="claude-code")
harness = create_harness(preset="langgraph")
result = quick_run("task", preset="crewai")

Build from Source

git clone https://github.com/jalajagrawalgenai/HarnessForge.git
cd HarnessForge/packages/forge-py
pip install maturin
maturin develop

# Verify
python -c "from forge_sdk import get_version; print(get_version())"

Publishing

cd packages/forge-py
pip install maturin twine
maturin build --release
twine upload target/wheels/forge_sdk-*.whl

Or push a v* tag — CI builds wheels for Python 3.10–3.14 on Ubuntu, Windows, and macOS automatically.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

forge_agent_sdk-0.3.0-cp314-cp314-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.14Windows x86-64

forge_agent_sdk-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

forge_agent_sdk-0.3.0-cp314-cp314-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

forge_agent_sdk-0.3.0-cp313-cp313-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.13Windows x86-64

forge_agent_sdk-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

forge_agent_sdk-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

forge_agent_sdk-0.3.0-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

forge_agent_sdk-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

forge_agent_sdk-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

forge_agent_sdk-0.3.0-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

forge_agent_sdk-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

forge_agent_sdk-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

forge_agent_sdk-0.3.0-cp310-cp310-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.10Windows x86-64

forge_agent_sdk-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

forge_agent_sdk-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file forge_agent_sdk-0.3.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 28772e7887460e5acd31838a4ad28d832bbf2ff547ed4f530ae9e08c3d5583da
MD5 d04bbe129d181c52d62631898bdcccf9
BLAKE2b-256 8a2b8c302b845636299a365d494e1f0781aeeeda59c2e4dbbde6a89e2b8758ec

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f3c30c9318fad07ab013f6b068eefca32130cb16ee158e78836f183528eac1e9
MD5 1e595c6f14ed967d8da83ac6376ff533
BLAKE2b-256 efcd2f704c1e920f8ef1b991d16912cb19225cd42b888fa0146c345cc9206d22

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb826477e7bcb7caee8e683417381dad3889d8818496b6c87b64fd2ba0786acc
MD5 b371f970b9fb7286fc8927e8128f2255
BLAKE2b-256 f54c818bd86a76b1a9f271d68e5bfd91936d10dd2f094cdf00c464060c38cdd4

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 400d87c2cbfb70991c9fa0d61d763a90fa90e1b5764c66985aa79f388fe143c2
MD5 091b4efde84f7e3f0e5c665260855b96
BLAKE2b-256 b0744011a3646bd9fb4dbb20873aabacdafb737d13d1d67eb3991a83272e8115

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9eac7e5ec3a2156a74916ce193a13bb033f32a063c9ce9c575f4cf09178118e2
MD5 67952a40aa8388192c6043ec1a08e7a9
BLAKE2b-256 4f9fd9a289e3e9292dd01bb7feca12dc7857112d8b9c38796982f7267f8b1a59

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 19ec71f6569c4d868bc2757e41d916edcedd21316386e18750a388744dc9b279
MD5 72746930515a31d9ba4ec87c9d3e110c
BLAKE2b-256 381929938d0c50ce63df15fd4f810966ebc8063dcc4a07997ea7a37530b1de4f

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2d14e021e5a7c11fde0adcecc08022a158bd163bb4d1a332deafc163cdac3730
MD5 abdbd18f42b1968001f9ea9449cdd75f
BLAKE2b-256 76e514edd4b7b18dbe2275fc763a83837ebffa9e5b5494ea08099e13f2bd2f5a

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4dd01ddebdf84deceec6466a034c1441d9c54e3ea594d1f8038a8c2e5cb49f43
MD5 9957c25be1d47830d4b9f4f1c2c27d62
BLAKE2b-256 16419484f55d86979e5fbc21f9b608ce756414df12e7d541831cb34e1ac8a6d0

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95f1ad988b9ceef2fe3c86069eef1865e214f033760e3b06bbce19995d030dac
MD5 3384bffa45db78ebae0c0b6d0099b419
BLAKE2b-256 0e4ed5c52d0d2abedbe50d2ffc91affcefaa09ae7b5e60e11bf27f94aa68e7ef

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0d4a7ad33f53d3bec24ef7f3f2c05a449f00814b3a97380eaf0d8344a1f0119b
MD5 a71cd32698b1c69d43b6e86ab716ee16
BLAKE2b-256 e7f996a5e9468255eafc1f932474cb14a562f81d06f22cfa605e20b8cd527622

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fa71c3a78cae9b03bfdea6b23a5244dfa17eec96cdee1e3c7e28c6393d87b034
MD5 45ae55551d882e9165c10fcdbd04803e
BLAKE2b-256 8691b29bbee470360f94d8f7fcc4c3c11b42176a996790d36ed4def3961ea367

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03df15cb91e237b529850c946af389c8212589c0d31d190898231b8cd102e34a
MD5 594766ed418e08bd6400668534321bb0
BLAKE2b-256 d4654bd28a2d4eb4113162986bafab7441ee8546e9cafc3c484c1ca9e0beea35

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 88a5052e13c887f2467a2b840e7c7d9dafefe5d50e5607a1c7b6bc95b44f1484
MD5 954b0104b24a3c3b6324e43f1092339b
BLAKE2b-256 04e3ad60e23115bd4645a3202938d90d29bdd84da665631fccbeb3ced4567173

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6717c3d973417a8ebf2e7e2d5969027aa4ef5f43ec535936227e9a7e3d309c97
MD5 6adfc4554a07fd62fc1c4f0844ff9a75
BLAKE2b-256 800635e39a668147835cd1405abdb19762ebbda189d86c62c9c00e83d9b8f81d

See more details on using hashes here.

File details

Details for the file forge_agent_sdk-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for forge_agent_sdk-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67c789bab7d3c0c78686436ba3d3312a27ef286d04d0241edb55fa1fbff98d0e
MD5 a724c8f930afbb002a3f5c5d465659b4
BLAKE2b-256 edac4117ae2f8a7245a2901ccdd9ee19fcdfdb7573eac924d5a5b6e4c645cf55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page