This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.4 instead.
Reason given by maintainers: Superseded by 0.1.4: CLI routing fix, FastMCP bounds, security docs
swallo — Agent Context Handoff
Portable, reviewable handoff between any AI chat agent and any IDE with zero-network runtime isolation.
swallo is a local-first, zero-network Python package and security CLI tool designed to transport structured conversational and debugging context between AI chat agents (ChatGPT, Claude, Gemini) and agentic IDE environments (Claude Code, Cursor, Antigravity).
Context travels as an integrity-checked, schema-validated JSON "context packet" with cryptographic content addressing, deterministic canonicalization, explicit redaction bounds, Trojan Source sanitization, and zero network calls in the core runtime.
Architecture Overview
flowchart TD
subgraph Capture["1. Ingest & Capture"]
Chat["Chat Session / Export"] --> Prompt["swallo prompt / paste"]
Vendor["Vendor JSON / Markdown"] --> Import["swallo import"]
end
subgraph SecuritySpine["2. Security & Redaction Spine"]
Prompt --> Redact["Redaction Engine<br/>(Decoded Variants & Caps)"]
Import --> Redact
Redact --> Sanitize["Trojan Source Sanitizer<br/>(CVE-2021-42574 BiDi Neutralization)"]
Sanitize --> Canonical["Swallo Canonical JSON v1<br/>(Float-Free, NFC-Normalized)"]
end
subgraph Storage["3. Content-Addressed Local Store"]
Canonical --> SQLite["SQLite Store + WAL<br/>(%LOCALAPPDATA% / XDG)"]
Canonical --> EventLog["HMAC / Ed25519 Signed Ledger<br/>& Event Log Chain"]
end
subgraph Consumption["4. Human Review & Delivery"]
SQLite --> CLIReview["swallo approve / send<br/>(Interactive TTY Required)"]
SQLite --> MCPServer["swallo mcp<br/>(Draft Quota + Token Bucket)"]
CLIReview --> IDE["Target IDEs:<br/>Claude Code / Cursor / Antigravity"]
MCPServer --> IDE
end
Installation
swallo is available on PyPI (pypi.org/project/swallo/). Requires Python >= 3.11.
# Install swallo from PyPI (zero third-party runtime dependencies beyond Pydantic)
pip install swallo
# With optional extras:
pip install "swallo[mcp]" # FastMCP server integration
pip install "swallo[sign]" # Ed25519 passphrase signing via cryptography
pip install "swallo[tokens]" # Token counting via tiktoken
pip install "swallo[dev]" # Development, testing, and benchmark suite
Dependency Isolation Guarantee
The core runtime strictly requires only pydantic>=2.0.0 and the Python standard library. Optional dependencies (mcp, cryptography, tiktoken) are imported lazily on demand. Importing swallo emits zero warnings under python -W error and will never load optional modules into sys.modules.
Quick Start
For a complete 3-minute setup walkthrough for Claude Code, Cursor, and Antigravity IDEs, see the Quickstart Guide.
- Initialize the local store:
swallo init - Verify environment health:
swallo doctor - Capture context via structured paste:
swallo prompt --instructions > prompt.txt # Paste context into prompt.txt, then save: swallo save --file prompt.txt --target antigravity
- Inspect and approve the packet:
swallo show pkt_latest swallo approve pkt_latest --target antigravity
- Deliver to target IDE:
swallo send pkt_latest --target antigravity
CLI Command Reference
swallo provides 23 structured subcommands:
| Command | Synopsis | Description |
|---|---|---|
swallo init |
swallo init [--force] |
Initialize local store directory, database, HMAC key, and default config. |
swallo doctor |
swallo doctor [--json] |
Diagnose environment, permissions, key health, and workspace roots. |
swallo prompt |
swallo prompt [--instructions] |
Generate capture prompt template for chat assistants. |
swallo save |
swallo save [--file F] [--target T] |
Ingest, redact, canonicalize, and store a new context packet. |
swallo import |
swallo import <path> [--format FMT] |
Import vendor chat exports (ChatGPT, Claude, Gemini) securely. |
swallo merge |
swallo merge <base> <incoming> |
Three-way merge two packets against a common base. |
swallo resolve |
swallo resolve <pkt> [--accept OURS|THEIRS] |
Resolve merge conflicts in a packet. |
swallo show |
swallo show <pkt_id> [--raw] [--json] |
Inspect packet details, decisions, constraints, and provenance. |
swallo edit |
swallo edit <pkt_id> |
Interactively edit packet fields with schema re-validation. |
swallo approve |
swallo approve <pkt_id> --target T |
Record cryptographic approval in local ledger (TTY required). |
swallo send |
swallo send <pkt_id> --target T |
Materialize two-file delivery stub and handoff data file for IDE. |
swallo load |
swallo load <pkt_id> |
Load packet into memory or inspect delivered state. |
swallo diff |
swallo diff <pkt_a> <pkt_b> |
Show structural and field-level diff between two packets. |
swallo list / status |
swallo list [--limit N] |
List packets, drafts, approval status, and timestamps. |
swallo log |
swallo log [--verify] |
Inspect audit event log and verify cryptographic hash chain. |
swallo staleness |
swallo staleness <pkt_id> [--ack] |
Check git drift against HEAD; acknowledge critical drift. |
swallo drafts |
swallo drafts [--clean] [--quota] |
Inspect and clean pending unapproved MCP draft packets. |
swallo breaker |
swallo breaker [--reset] |
Inspect or reset the MCP save circuit breaker. |
swallo bench |
swallo bench <run|verify> |
Execute or verify deterministic benchmark suite. |
swallo mcp |
swallo mcp [--transport stdio] |
Start the Model Context Protocol (MCP) server. |
swallo help |
swallo help [command] |
Display detailed command help and argument descriptions. |
swallo version |
swallo version [--json] |
Print tool version, supported schema versions, and runtime info. |
Exit Codes
0: Success.1: General application error.2:UsageError(invalid arguments, flags, or unknown command).3:ValidationError(schema or boundary violation).4:RedactionBlockedError(unredacted secret detected in fail-closed mode).5:ConflictError(unresolved merge conflict).6:NotApprovedError(attempting to consume unapproved context).7:StaleContextError(packet blocked by staleness drift policy).8:IntegrityError(corrupt database or broken event-log hash chain).9:SecurityError(path traversal, symlink escape, or forged approval).10:RateLimitedError(MCP session token bucket exhausted).11:SessionPausedError(MCP circuit breaker tripped after repeated blocked saves).12:DraftQuotaExceededError(draft count or storage quota exceeded).13:UnregisteredProjectError(workspace not registered in global store).
Configuration Reference
Configuration is stored in <store>/config.toml (e.g. %LOCALAPPDATA%\swallo\config.toml on Windows, ~/.local/share/swallo/config.toml on Linux).
[storage]
busy_timeout_ms = 5000 # SQLite WAL busy handler timeout
max_packet_bytes = 10485760 # 10MB packet payload limit
max_json_depth = 64 # Maximum nested JSON parsing depth
[redaction]
mode = "mask" # "mask", "remove", or "fail_closed"
scan_decoded_variants = true
max_decode_depth = 3
max_decode_bytes = 65536
decode_timeout_ms = 200
[mcp]
enabled = true
token_bucket_rate = 30 # 30 requests per minute
token_bucket_burst = 10 # Burst allowance
draft_quota = 50 # Maximum unapproved drafts per project
circuit_breaker_threshold = 5 # Consecutive blocks before session pause
[approve]
signing = "hmac" # "hmac" (default) or "passphrase" (Ed25519)
require_tty = true # Invariant: agents cannot approve context
MCP Integration
swallo provides standard Model Context Protocol (MCP) support over stdio. The server exposes swallo_save_draft, swallo_load_packet, and swallo_query_store. In accordance with security invariant ADR-007, no approve tool is exposed via MCP.
Claude Code
Add to your project's .mcp.json or user-level config:
{
"mcpServers": {
"swallo": {
"command": "swallo",
"args": ["mcp"]
}
}
}
Cursor
Add to Cursor's MCP Settings (Settings > Features > MCP):
- Name:
swallo - Type:
command - Command:
swallo mcp
Antigravity
Add to .gemini/antigravity/mcp/swallo.json or your MCP server configuration:
{
"name": "swallo",
"command": "swallo",
"args": ["mcp"]
}
Security Model & Structural Invariants
- Two-File Delivery: Chat-derived context is written to isolated data files under
.swallo/handoff/, leaving only a short pointer stub in rules files. - Mandatory Interactive Approval: Approval requires an interactive TTY. Agents cannot approve context.
- Deterministic Content Addressing: All packets and items are addressed by SHA-256 hashes of their canonical JSON representations.
- Trojan Source Sanitization: Bidirectional overrides, zero-width characters, and Unicode tag characters (CVE-2021-42574) are strictly stripped or neutralized.
- Circuit Breaker: 5 consecutive blocked saves trip the MCP circuit breaker, pausing agent activity until reset by the human operator.
Community & Code of Conduct
Swallo is an open, welcoming community. All participants are expected to adhere to our Code of Conduct (Contributor Covenant v2.1).
License
This project is dual-licensed under:
at your option. See LICENSE for details.
Metadata
Release files for swallo 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swallo-0.1.2.tar.gz | 249.6 kB | With provenance | Details for swallo-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swallo-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for swallo-0.1.2-py3-none-any.whl |
Total release size: 403.0 kB
Release files / swallo-0.1.2.tar.gz
| Download URL | swallo-0.1.2.tar.gz |
|---|---|
| Size | 249.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
608737afff56a53aac6b1c14e7c1c3a8c03e92d02f0c269b71d196a9c0cf070c
|
|
BLAKE2b-256 checksum How to use checksums |
27a9c1187483577248637b4ffd13d895b328863681742bc35928112bb50b88ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 12, 2026.
Transparency logRelease files / swallo-0.1.2-py3-none-any.whl
| Download URL | swallo-0.1.2-py3-none-any.whl |
|---|---|
| Size | 153.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfae4b2e9ff2f4acce528fb98792ea0e346259888b680e2ad7d31825deef5a06
|
|
BLAKE2b-256 checksum How to use checksums |
99840817c408badff0b882877cdb0ec1f612cb117f44048cf0b409ba1d0a3d07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 12, 2026.
Transparency logSecurity for swallo 0.1.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for swallo-0.1.2.tar.gz
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 Nov 12, 2026.
Transparency logA 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.