Metadata-Version: 2.4
Name: codeark-pitax
Version: 0.2.3
Summary: Deterministic prompt-injection scanner (PITAX): scan repos/docs for AI-assistant hijacking patterns. Zero dependencies, local only.
Project-URL: Homepage, https://github.com/a9320/arcanum-spark
Project-URL: Repository, https://github.com/a9320/arcanum-spark
Project-URL: Issues, https://github.com/a9320/arcanum-spark/issues
Keywords: prompt-injection,security,static-analysis,llm,pitax,ai-safety,code-review
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# codeark-pitax

Deterministic prompt-injection scanner (PITAX rules): scan repositories, documents
and untrusted text for AI-assistant hijacking patterns — invisible Unicode, trojan
source, instruction overrides, encoded payloads. Zero dependencies, zero network,
zero model calls; everything stays on your machine.

Part of CodeRisk Arcanum (https://github.com/a9320/arcanum-spark).
Source / issues: https://github.com/a9320/arcanum-spark

## Usage

```bash
# scan a repository (or a single file) — reports land in ./pitax-report
codeark-pitax ./your-repo --formats html,json --out ./pitax-report

# CI gate: exit 3 when anything at or above `high` is found
codeark-pitax ./your-repo --fail-on high
```

## Exit codes (CI gating)

| Code | Meaning |
|---:|---|
| 0 | scan finished, nothing at/above the threshold |
| 1 | bad arguments, or the target path does not exist |
| 3 | findings at/above the threshold (`--fail-on` / `--fail-on-findings`) |

`--formats json,sarif,markdown,html` writes report artifacts; `sarif` is accepted by
GitHub code scanning. Nothing is uploaded and no model is called.

```yaml
# .github/workflows/pitax.yml
- run: pip install "codeark-pitax>=0.2.3"
- run: codeark-pitax . --fail-on high --formats sarif,json
- uses: github/codeql-action/upload-sarif@v3
  if: always()
  with: { sarif_file: pitax-report/report.sarif }
```

Boundary: a rule match is a **report**, not a confirmed attack. Output is advisory and
the tool never modifies or deletes files. Directory scans never follow symlinks or
junctions and are bounded (file count / depth / total bytes), and a partial scan
declares what stopped it.

## Attribution

The PITAX rule set is derived from the Prompt Injection Taxonomy v1.6.1 by
Jason Haddix / Arcanum (CC BY 4.0).

License: MIT (same as arcanum-spark).
