bastioncorpus
The shared prompt-injection corpus for the bastion trilogy. One canonical, versioned dataset — attack strings, false-positive traps, taxonomy — that all three tools pull from instead of each rolling its own.
| tool | role | depends on bastioncorpus since | reads bastioncorpus as |
|---|---|---|---|
| agentbastion | prevent | v0.9.0 | SemanticDetector intent templates |
| bastionprobe | attack | v0.17.0 | fireable payloads (load_payloads) |
| bastiontrace | investigate | v0.2.0 | injection signatures (analyzer._PATTERNS) |
All three take bastioncorpus>=0.2.0 as a dependency and keep a built-in
fallback, so one source of truth feeds prevent, attack, and investigate.
Same taxonomy, three directions. 150 rows (99 malicious payloads / 51
benign false-positive traps; en/it/de/fr/es). No LLM, no cloud, no
dependencies — pure data plus a loader and three format adapters.
Install
pip install bastioncorpus
Use
Inspect:
bastioncorpus stats
bastioncorpus list --category indirect_injection
bastioncorpus validate
Export into each tool's native file:
bastioncorpus export --format probe --out payloads.jsonl # bastionprobe loads this
bastioncorpus export --format trace --out signatures.jsonl # bastiontrace matches these
bastioncorpus export --format semantic --out corpus.jsonl --templates templates.jsonl # agentbastion
From Python:
from bastioncorpus import load_corpus, to_probe, to_semantic, to_trace
rows = load_corpus()
payloads = to_probe(rows) # fireable attack payloads
semantic = to_semantic(rows) # {"templates": [...], "corpus": [...]}
signatures = to_trace(rows) # canary-stripped substring signatures
Decode and rescan
Obfuscation jailbreaks hide an instruction in an encoding the model reads fluently but a text detector does not. Every Bastion scanner runs its checks on the decoded views too:
from bastioncorpus import variants
for d in variants(text): # encoded runs only (cheap): what scanners use
print(d.encoding, d.text) # e.g. "base64", "hex>base64", "binary", "tags"
variants(user_text, transforms=True) # + rot13, leet, reversed, spaced letters
- Run-based: base64/base64url, base32, hex, binary, ascii85, base85, Morse,
percent-encoding,
\u/\xescapes, Unicode tag characters. - Text filter: decoded output is kept only if it reads like text, so tokens, hashes, keys and image data produce nothing.
- Bounds: at most 4x the input and 1 MB of output; every regex is linear.
Limits: made-up ciphers, acrostics and "first letter of each word" schemes are not decodable by enumeration. Detection raises the bar; the guarantee comes from action-level controls (allow lists on what the agent may call), which encoding cannot bypass.
Schema
One row per attack (or benign trap). text may carry a single {canary}
placeholder the attack runner fills per run; defense and forensics adapters
strip it.
| field | meaning |
|---|---|
id |
stable unique id |
text |
the string (optional {canary} slot) |
category |
canonical class: direct_injection, indirect_injection, instruction_override, jailbreak_persona, exfiltration, delimiter_injection, obfuscation, or benign_* |
label |
malicious | benign (benign = false-positive trap, to measure over-blocking) |
lang |
language code (en, it, de, …) — never baked into category |
tactic |
framing tactic (authority, data-field, egress-legit, …) |
channel |
where planted (tool_output, user_input) |
check |
how a hit is scored (canary, tool, none) |
forbidden_tool |
tool a check=tool payload tries to trigger |
severity |
0–5 |
intent |
plain-language restatement, for semantic templates |
Direct/user_input rows are defense and forensics material; only
tool_output payloads with a scoring check are fired as attacks.
Why
Before this, each tool hand-maintained overlapping payload lists that drifted apart. bastioncorpus makes one of them authoritative: fix a payload here, every tool in the trilogy gets it on the next export.
License
MIT
Metadata
Release files for bastioncorpus 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bastioncorpus-0.6.0.tar.gz | 40.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bastioncorpus-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.4 kB
Release files / bastioncorpus-0.6.0.tar.gz
| Download URL | bastioncorpus-0.6.0.tar.gz |
|---|---|
| Size | 40.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35e2ee9056cceb06b13b7a18f831559ded7f3b14bc7dac9315bbf63716584b4c
|
|
BLAKE2b-256 checksum How to use checksums |
9c5d8504a835252a2864a692ce8366553faa6be0f0467458a3d97995b8c57323
|
| 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 Oct 12, 2026.
Transparency logRelease files / bastioncorpus-0.6.0-py3-none-any.whl
| Download URL | bastioncorpus-0.6.0-py3-none-any.whl |
|---|---|
| Size | 30.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96d7268cfafc2be0908382b61af8b67dec19058e2877657b217e68be0552a00a
|
|
BLAKE2b-256 checksum How to use checksums |
bd7a9542bb61a3e5d7bbf56b6f117949f2fd938287228a04faeff465147f49c8
|
| 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 Oct 12, 2026.
Transparency log