Guardrails for LLM output, in one line.
OpenAI Agents SDK guardrails, LangChain runnables and callbacks, and a typed client. Every message gets a pass / fail / review verdict with calibrated confidence before it reaches your user.
pip install "overwing[agents]" # OpenAI Agents SDK guardrails
pip install "overwing[langchain]" # LangChain guard runnable + callbacks
Get a free API key at overwing.ai (250 evaluations a day), or let your agent sign itself up with one POST to /api/v1/signup. Try it first with no key: paste anything into the console at overwing.ai.
OpenAI Agents SDK guardrails
from agents import Agent, Runner, InputGuardrailTripwireTriggered, OutputGuardrailTripwireTriggered
from overwing.openai_agents import overwing_input_guardrail, overwing_output_guardrail
agent = Agent(
name="Support",
instructions="Help the customer.",
input_guardrails=[overwing_input_guardrail()], # scores the user's message
output_guardrails=[overwing_output_guardrail()], # scores the agent's final answer
)
try:
result = await Runner.run(agent, "Reach me at dana@example.com to sort out the refund.")
except (InputGuardrailTripwireTriggered, OutputGuardrailTripwireTriggered) as exc:
evaluation = exc.guardrail_result.output.output_info["evaluation"]
print(evaluation.verdict, evaluation.failed_rules) # "fail" ["pii_detected"]
Both accept rule_set, trip_on="fail" | "fail-or-review", metadata, on_verdict, and fail_open. Input guardrails run in parallel with the agent by default; pass run_in_parallel=False to block before the model is called. Reads OVERWING_API_KEY from the environment, or pass client=AsyncOverwing(api_key=...).
LangChain
Pipe a guard after your model. It scores the answer and acts on the verdict before anything downstream sees it.
from overwing.langchain import overwing_guard, OverwingGuardrailError
chain = prompt | llm | overwing_guard(on_fail="replace") # or on_fail="raise" (default) / "annotate"
msg = chain.invoke({"question": "..."})
msg.response_metadata["overwing"] # {"verdict": "pass", "confidence": 0.97, "failed_rules": [], ...}
Or observe every LLM call with a callback handler, which aborts the run on fail:
from overwing.langchain import OverwingCallbackHandler
handler = OverwingCallbackHandler(check_input=True) # also scores the user's prompt
llm.invoke("...", config={"callbacks": [handler]})
handler.verdicts # [("input", Evaluation), ("output", Evaluation), ...]
Both accept rule_set, metadata, on_verdict, and fail_open. There is an AsyncOverwingCallbackHandler too.
Client
from overwing import Overwing, AsyncOverwing
ow = Overwing() # or Overwing(api_key="ow_live_...")
e = ow.evaluate("Reach me at dana@example.com to sort out the refund.")
e.verdict # "fail"
e.recommended_action # "redact": remove the contact details, the message itself is fine
e.failed_rules # ["pii_detected"]
# Give the rules context and use the context-aware prebuilt set
ok = ow.evaluate(
"Reach me at dana@example.com to sort out the refund.",
rule_set="outbound-message",
context={"recipient": "one known customer", "channel": "email", "owns_contact_info": True},
)
ok.verdict # "pass": the details are the sender's own, deliberately shared
e.results[1] # RuleResult(rule="pii_detected", answer=True, confidence=0.98, verdict="fail", ...)
batch = ow.evaluate_batch([{"id": "a", "input": "..."}, {"id": "b", "input": "..."}])
ow.create_rule_set(name="Support tone", slug="support-tone", rules=[...])
ow.usage()
async with AsyncOverwing() as aow:
e = await aow.evaluate("...")
OverwingError carries status and retry_after_seconds. 429s with a short Retry-After and 5xx are retried automatically. Pass idempotency_key= to make retries safe. Python 3.10+.
How verdicts work
Each rule has a fail condition, an optional review threshold, and a weight. The prebuilt content-safety set checks toxicity, personal data, self-harm, sexual content, and severity. fail means a rule matched. review means a rule was unsure. pass is everything else. Full guide: overwing.ai/llms.txt. Reference: overwing.ai/docs.
Also from Overwing
overwingon npm: the same client, a Vercel AI SDK middleware, and Agents SDK guardrails for JavaScript.overwing-mcp: the guardrails as MCP tools for Claude, Cursor, and any MCP client.
MIT © Overwing. Verdicts are produced by TypeSafe's Jev System One model; Overwing is not affiliated with TypeSafe.
Release files for overwing 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| overwing-0.2.0.tar.gz | 193.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| overwing-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 206.5 kB
Release files / overwing-0.2.0.tar.gz
| Download URL | overwing-0.2.0.tar.gz |
|---|---|
| Size | 193.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44f40957e552d583960a248d66ecb24b4fa3ae2c74e2595e3d316015c54dc4ee
|
|
BLAKE2b-256 checksum How to use checksums |
c7c0ab1b0777383ebf96017f41299f1dc2d87e965a96f9a99a8ace3fc6845081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / overwing-0.2.0-py3-none-any.whl
| Download URL | overwing-0.2.0-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6bed5e29d6ca19101371604da43a4255dce17d81440e76106e90842a41b55c46
|
|
BLAKE2b-256 checksum How to use checksums |
13e2e6543872fb226bcd60fdc8e6044fa30ed4edf1d1813c41983b7577b82227
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log