You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update docs for guardrail middleware refactor, bump to v0.2.0
ARCHITECTURE.md and WORKFLOW.md still referenced the old runner internals
(direct StepTracker usage, inline retry/error counting) instead of the
middleware pattern shipped in #9. Update dependency diagram, data flow
pseudocode, mermaid flowcharts, and type reference to reflect
ResponseValidator / StepEnforcer / ErrorTracker composition. Also fix
license (Apache→MIT) and a broken relative link in WORKFLOW.md.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add Guardrails facade for foreign loop integrators
Two-method API wrapping ResponseValidator, StepEnforcer, and ErrorTracker:
guardrails.check(response) -> CheckResult (execute/retry/step_blocked/fatal)
guardrails.record(executed) -> bool (terminal reached?)
Rework examples/foreign_loop.py into two parts: Part 1 uses the new
Guardrails facade, Part 2 shows the granular middleware for custom control.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add ADRs for proxy and text response intent, update middleware docs
ADR-012: Revised proxy design -- extract WorkflowRunner's front half
(compaction, reasoning folding, message merging, serialization,
validation) into reusable component. Proxy is WorkflowRunner's front
half behind an HTTP server, not a reimplementation.
ADR-013: Text response intent -- when model chooses text over tools.
Three approaches: intentional flag on TextResponse, synthetic respond
tool injection, tool_choice respect.
USER_GUIDE Mode 3: Add Guardrails facade (simple two-call API)
alongside existing granular middleware API.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# result.action == "execute" -- run the tools, then tell forge what succeeded:
71
+
execute(result.tool_calls)
72
+
done = guardrails.record([tc.tool for tc in result.tool_calls])
73
+
```
74
+
75
+
**Granular API** (individual components for custom control):
76
+
49
77
```python
50
78
from forge.guardrails import ResponseValidator, StepEnforcer, ErrorTracker
51
79
@@ -71,7 +99,7 @@ for tc in result.tool_calls:
71
99
errors.record_result(success=ok)
72
100
```
73
101
74
-
**Best for:** Framework developers embedding forge's guardrails inside a custom agent, a proprietary pipeline, or another open-source framework. For a complete runnable example, see [`examples/foreign_loop.py`](../examples/foreign_loop.py). For design rationale, see [ADR-011](decisions/011-guardrail-middleware.md).
102
+
**Best for:** Framework developers embedding forge's guardrails inside a custom agent, a proprietary pipeline, or another open-source framework. For a complete runnable example showing both APIs, see [`examples/foreign_loop.py`](../examples/foreign_loop.py). For design rationale, see [ADR-011](decisions/011-guardrail-middleware.md).
0 commit comments