syl-guardian-client
Python client for Syl Guardian, a causal guardrail for AI agent decisions.
Before an agent acts on a claim such as "this campaign's ROAS is 4x, scale it up", Guardian checks whether the effect is causal or merely confounded (for example, branded search that would have converted anyway) and returns a pass, caution or hold verdict, with the naive vs. confounder-adjusted effect and a confidence interval.
Estimates are computed deterministically by statistical code on the hosted service, never by an LLM. This package is a thin MIT-licensed client: it only makes HTTP calls to https://guardian.sylai.io.
Install
pip install syl-guardian-client # client only
pip install 'syl-guardian-client[crewai]' # + CrewAI tool
pip install 'syl-guardian-client[langchain]' # + LangChain tool
Get a trial API key at https://sylai.io/guardian and set it:
export SYL_GUARDIAN_API_KEY=<your key>
Each review counts against your plan or trial quota. Uploads do not.
Use
from syl_guardian_client import GuardianClient
guardian = GuardianClient() # reads SYL_GUARDIAN_API_KEY
result = guardian.review(
"ad_spend",
"conversion_value",
data=rows, # list of row dicts or a DataFrame
time_col="date",
step=500, # the proposed budget change
known_confounders=["brand_query_click_pct", "holiday_season_index"],
)
print(result.verdict) # "pass" | "caution" | "hold"
print(result.correlational_effect, result.ate, result.ci)
if result.held:
raise RuntimeError(result.recommended_action)
Send only the cause, effect, time_col and confounder columns. Downstream columns such as roas, clicks or conversions are bad controls and bias the estimate.
For datasets of more than about 200 rows, upload the CSV instead of sending rows inline:
result = guardian.review_file("ad_spend", "conversion_value", "campaign.csv", time_col="date")
Uploaded datasets are single-use: each is deleted when reviewed, so upload again to re-run.
Review arguments
| Argument | Description |
|---|---|
cause, effect |
Required. Column names for the claim. |
data, csv or dataset_id |
Dataset as row dicts or a DataFrame, CSV text, or an uploaded dataset id. Exactly one. |
known_confounders |
Columns to adjust for; otherwise discovered automatically. |
time_col, adstock |
Time-series handling: row ordering and carryover effects. |
step, units, context |
Restate the effect in business terms. |
test_design, cate, sensitivity |
Optional extras: spend-cut test design, subgroup effects, sensitivity checks. |
seed, config, estimator |
Reproducibility and engine settings. Set config={"cleaning": "rule", "discovery": "rule"} for strict reproducibility. |
Errors raise GuardianError with status_code, error (for example trial_expired, quota_exceeded) and detail.
CrewAI
from crewai import Agent
from syl_guardian_client.integrations.crewai import SylGuardianTool
media_buyer = Agent(
role="Media Buyer",
goal="Change ad budgets only when the lift is incremental",
backstory="Checks every budget change with Syl Guardian before applying it.",
tools=[SylGuardianTool()],
)
LangChain
from syl_guardian_client.integrations.langchain import guardian_review_tool
tools = [guardian_review_tool()] # pass to your agent; API errors become tool messages
MCP
Guardian is also a hosted MCP server (https://guardian.sylai.io/mcp). See https://github.com/connor274/syl-guardian-mcp.
License
MIT. The Guardian service itself is hosted and closed; this package contains no engine code.
Metadata
Release files for syl-guardian-client 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| syl_guardian_client-0.1.0.tar.gz | 10.1 kB | With provenance | Details for syl_guardian_client-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| syl_guardian_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for syl_guardian_client-0.1.0-py3-none-any.whl |
Total release size: 20.6 kB
Release files / syl_guardian_client-0.1.0.tar.gz
| Download URL | syl_guardian_client-0.1.0.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e815079ff88db9ee8c8be557edfff2f616e45abbd1b4dc587956adb8826e1c17
|
|
BLAKE2b-256 checksum How to use checksums |
dc9dc49364081e75980deedab8b752694d180125df1b7a674b68d9b8c7000bdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 28, 2026.
Transparency logRelease files / syl_guardian_client-0.1.0-py3-none-any.whl
| Download URL | syl_guardian_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
592ec9e8163d4ac8dab571c77bc55714dbff1d67b6ba35b6fe303df5f46ea777
|
|
BLAKE2b-256 checksum How to use checksums |
a5763f6369559a50687901f2564a167b292846ce9bb77e071632e3a343c05c7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 28, 2026.
Transparency logSecurity for syl-guardian-client 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for syl_guardian_client-0.1.0.tar.gz
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 Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.