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=..., AICORDON_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 ai-cordon.com.

Metadata

Release files for aicordon 1.3.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 aicordon 1.3.0
File Size Uploaded
aicordon-1.3.0.tar.gz 1.4 MB Details

Built distribution (wheel)

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

Total release size: 1.9 MB

Release files / aicordon-1.3.0.tar.gz

Download URL aicordon-1.3.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ad0c2ab8147abddc615273f0afdc52dba3cbbed0d0f79a475146a87cbb756ae4
BLAKE2b-256 checksum
How to use checksums
9f74d22a284f388c9215778f18b6479fd10884b7f688d17e8b27bd09802d89f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

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

Download URL aicordon-1.3.0-py3-none-any.whl
Size 529.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8282f8c819e66f0055f670e3c5ace4c8cfb2d5fd4c70332ae23dab48cca47db1
BLAKE2b-256 checksum
How to use checksums
bd136173870347f928e3df687c0831feca4ce141709979210706287bff5a9b97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release history Release notifications | RSS feed

1.4.0

2 release files

This release

1.3.0 This release

2 release files

1.2.1

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

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