Skip to main content

AI Cordon

PyPI License: Apache 2.0 Python Dependencies

Find prompt injections in the text your model reads: mail, pages, tool results, retrieved chunks.

Two detectors with the same Python API and CLI.

Picket — fast Intent — accurate
what it is a signature rule, runs in your process the full AI Cordon detector, over an API
speed 100–200 documents a second on one CPU core a network round trip per document
false alarms ~1 in 1 000 clean documents ~1 in 10 000 clean documents (FPR 1e-4)
catches known phrasings: "ignore previous instructions", "reveal your system prompt" instructions in any wording, including ones hidden in markup
needs nothing: no model, no network, no key an API key
your text never leaves the process: Picket has no network code is sent to the AI Cordon API to be judged
details docs/picket.md docs/intent.md

Picket: bulk scanning, ingest pipelines, mail gateways, offline use. Intent: where a missed injection is expensive. They can be combined: Picket on everything, Intent on what matters.

Quick start

$ pip install aicordon
$ aicordon picket scan letter.txt          # local, works right away
$ aicordon login                           # once: stores the Intent API key
$ aicordon intent scan letter.txt
from aicordon import picket, intent

fast = picket.load()
full = intent.load()          # key: api_key=..., INOLA_API_KEY, or `aicordon login`

for det in (fast, full):
    rep = det.check(text)
    if rep.flagged:
        for f in rep.findings:
            print(det.title, f.threat, text[f.span[0]:f.span[1]])

A report lists findings with their positions. No findings does not mean no injection.

Both on the same five texts

python examples/compare.py runs both over examples/texts:

text                         Picket (local rule)              Intent (API)
01-obvious-email.txt         alarm  IPI/Secret.Reveal.C       alarm  score 0.98
02-support-ticket.txt        —                                alarm  score 0.98
03-release-notes.html        —                                alarm  score 0.99
04-warning-question.txt      —                                —      score 0.40
05-quarterly-report.txt      —                                —      score 0.11

Both flag 01. Texts 02 and 03 contain no known phrasing, so only Intent flags them. Text 04 is an ordinary question that contains "ignore" and "previous instructions"; neither detector flags it.

Licensing

Apache License 2.0 (LICENSE), including the Picket rule base. Contributions are accepted under the DCO: sign off your commits with git commit -s.

Get an Intent key at inola.ai. AI Cordon is now Inola: Intent runs on the Inola API (api.inola.ai), and the package name stays aicordon.

Metadata

Release files for aicordon 1.4.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 aicordon 1.4.1
File Size Uploaded Provenance Actions
aicordon-1.4.1.tar.gz 1.4 MB Without provenance Details for aicordon-1.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aicordon 1.4.1
File Interpreter ABI Platform Actions
aicordon-1.4.1-py3-none-any.whl Python 3 none any Details for aicordon-1.4.1-py3-none-any.whl

Total release size: 1.9 MB

Release files / aicordon-1.4.1.tar.gz

Download URL aicordon-1.4.1.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
5bab2b22709faad237980e8372955d0dafc3243fb7ff9ea0c2c4d13aefe910c8
BLAKE2b-256 checksum
How to use checksums
79ee7d533f26b8523000018f66c616c6b2968374d6d7ee8cdc11f7094791e8ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / aicordon-1.4.1-py3-none-any.whl

Download URL aicordon-1.4.1-py3-none-any.whl
Size 531.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0140106a2ca56e5ba50aeb47bbfff178a7b3e48dff9e7b99e94e406f367691e4
BLAKE2b-256 checksum
How to use checksums
5df859951c9e0d801babb994b10c4b846b267f5788eeb88110d6d9a749976a6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for aicordon 1.4.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

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