Skip to main content

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 pytest before 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for secure-ai-guard 0.2.1
File Size Uploaded
secure_ai_guard-0.2.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for secure-ai-guard 0.2.1
File Interpreter ABI Platform
secure_ai_guard-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / secure_ai_guard-0.2.1.tar.gz

Download URL secure_ai_guard-0.2.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cee97b91de14af5011dfa49f7bac49ba4265f8e91e2a54339e34b1aa09a294f0
BLAKE2b-256 checksum
How to use checksums
21e10a6aa94352946e17f06a7d6b129db0ac7577f563693a8d57d87338d53e0c
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

Release files / secure_ai_guard-0.2.1-py3-none-any.whl

Download URL secure_ai_guard-0.2.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f0c9f621ae13700a54ea4700343ffbdee614c71f67aed9a76a81e30bc4c29c8
BLAKE2b-256 checksum
How to use checksums
0e1a4fe64c5fe3f79433c9ab60a3016fa626d9a2f0e90088e887eeddd2ed3009
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

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page