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.0

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.0
File Size Uploaded
secure_ai_guard-0.2.0.tar.gz 13.3 kB Details

Built distribution (wheel)

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

Total release size: 23.5 kB

Release files / secure_ai_guard-0.2.0.tar.gz

Download URL secure_ai_guard-0.2.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
032ff43d494c4f0ecab589a64a4604cc0248ad4888789236520d2f98bc24d64f
BLAKE2b-256 checksum
How to use checksums
25e0ab1ba2c16e6c3505da50fda8ba668d848fe169b73d38a76be6a378d39b40
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.0-py3-none-any.whl

Download URL secure_ai_guard-0.2.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f72c1cd770219166db6e930abac72370f6bd07a4ef0c7799756bedaf967e7fa
BLAKE2b-256 checksum
How to use checksums
796eead7f0cfffe1b8f8d85c9248cfd43115e73f0c77cb44d9b8ba38e7dbd586
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

0.2.1

2 release files

This release

0.2.0 This release

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