secure-ai
Data loss prevention for AI agents. Put a check in front of every action an agent takes, before it takes it.
pip install secure-ai-guard
Status: written, not yet executed — there was no Python interpreter on the machine this was built on. Run
pytestbefore trusting it. The TypeScript SDK it mirrors does pass its suite.
The one thing worth knowing
guard wraps a function your agent already calls, and calls it with the
rewritten arguments:
from secure_ai import SecureAI
sai = SecureAI(api_key=os.environ["SECURE_AI_KEY"], agent="support-bot")
send_email = sai.guard("email.send", mailer.send)
send_email({"to": "ana@clientfirm.com", "body": "About invoice 4471…"})
The agent wrote a real address. mailer.send receives a stand-in. Nothing in
the agent's code had to check a decision — which is the point. Protection that
depends on remembering to check it ends at the fourteenth call site.
If the policy refuses, the wrapped function is never called and ActionBlocked
is raised.
As a decorator:
@sai.guarded("email.send")
def send(payload): ...
A whole toolbelt at once
tools = sai.guard_tools(agent.tools)
Wraps whichever attribute holds the callable — func, _run, run — so
LangChain and similar frameworks are governed in one line. Shapes it does not
recognise are returned untouched rather than raising.
Rules
Rules live on the account, not in the request. An agent cannot argue with them.
sai.set_policy({
"fallback": "redact",
"rules": [
{"kind": "secret", "decision": "block"},
{"kind": "card", "decision": "block", "direction": "outbound"},
{"kind": "email", "decision": "allow", "tools": ["crm.*"]},
],
"denyTools": ["shell.*"],
})
sai.allow_value("@ourcompany.com") # stop flagging your own domain
When an action contains several findings, the most severe decision wins.
The trail
sai.summary() # counts over a recent window
sai.audit(limit=100) # the records themselves
Records hold the kind and location of what was found — card at
body.payment.number — and never the value. Finding has no field for one.
When Secure AI is unreachable
Default is on_unreachable="closed": the action does not happen. Correct for a
security control, and it does mean an outage here stops agents.
SecureAI(api_key=..., on_unreachable="open") # availability over control
Failing open never waves a real refusal through — a 401, 402 or quota error is an answer, not an outage, and still raises.
No dependencies
Standard library only. This runs beside your model client and your framework, and every dependency it adds is a version conflict it can cause.
Full reference: https://secureai.one/developers
Metadata
Release files for secure-ai-guard 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| secure_ai_guard-0.2.2.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| secure_ai_guard-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.2 kB
Release files / secure_ai_guard-0.2.2.tar.gz
| Download URL | secure_ai_guard-0.2.2.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66931b8b491848c2090a05f080efcb329c72383b657a29452c2046a07bcd3bc8
|
|
BLAKE2b-256 checksum How to use checksums |
4c188897696caf1b29f726abc71c386a79dc79af4ae541b7a7a607baeb4b6c8f
|
| 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 20, 2026.
Transparency logRelease files / secure_ai_guard-0.2.2-py3-none-any.whl
| Download URL | secure_ai_guard-0.2.2-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2a82b730fe8cfec547aac92be77a5d2ef6b0b38c50882b6461b8e298a409e8e
|
|
BLAKE2b-256 checksum How to use checksums |
c22397d55ab011fa8f7d5b0c3016e5965521ff9ff0f52b845ce93218a32c8506
|
| 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 20, 2026.
Transparency log