Switch Protocol Agent v1.0
Zero-LLM Gate · Immune to Prompt Injection

Your agency does the work. Your keys stay with you.

Stop sending Cloudflare, AWS, and hosting credentials over WhatsApp. Keystead lets agency AI agents propose changes inside private Switch rooms, while secrets remain encrypted on the client machine. Nothing executes until the client types approve KS-0001.

$uv run keystead init && uv run keystead run
Traditional Agency SharingUncontrolled Scope
Plaintext Transmission: Passwords and API tokens sent over WhatsApp, Slack, or email persist forever in message logs.
Permanent Root Access: Agency engineers and autonomous agents retain admin access indefinitely without rotation.
Prompt Injection Hazard: If an agency AI agent gets compromised, client credentials enter the LLM context.
No Audit Trail: No verifiable record of who approved what change, when, or why.
Vector: Permanent credentials shared with third parties
The Keystead Gateway ModelDefault Deny
Zero-LLM on Key-Holder: The gate is pure deterministic Python. It parses JSON, matches rules, and holds zero AI surface.
AES-256-GCM Vault: Secrets never leave the client machine. Ephemeral in-memory decryption strictly for execution.
Strict Human-in-the-Loop: Only the pinned human approver can approve. Autonomous agent self-approvals are rejected.
SHA-256 Hash Chain: Every proposal, vote, and execution is sealed into an immutable audit.jsonl ledger.
Keystead Gate: Active & PinnedPolicy: FAIL-CLOSED
Six-Step Cryptographic Execution Protocol
01. Request

Agency asks agent for infrastructure update

02. Propose

Agent outputs structured JSON block

03. Check

Gate evaluates policy & emits card with hash

04. Approve

Client types "approve KS-NNNN"

05. Execute

Gate executes single API call with secret

06. Receipt

Cryptographic ledger line appended

SWITCH ROOM SIMULATOR

Interactive Approval Gate Workflow

Simulate an agency coding agent proposing an infrastructure change, test attack scenarios, and observe deterministic execution.

Room: #keystead-clientsite
4 Roster Pins
@keystead[Zero-LLM Gate]
23:40:02
keystead online · Switch room keystead-clientsite · Gate active (rules: 4, approvers: [client], vault: AES-256-GCM)
Step 0 of 6

Active Scenario Policy

Agency agent proposes adding a verification TXT record to clientsite.com.

Evaluation Result:
approve (matched rule #2: TXT on clientsite.com)
Proposal ID:KS-0001
Authorized:client (person only)
Key Storage:Client AES-256 Vault

Audit Ledger Entry

{
  "index": 14,
  "event": "executed",
  "proposal_id": "KS-0001",
  "approver": "client",
  "prev_hash": "9a3f4e22...",
  "hash": "a91c3e80c71...",
  "redacted_secret": "[REDACTED]"
}
Verified with keystead audit verify
Switch Security Matrix
Agency (DJ):Proposer only
Claude Code:Proposer (Zero Keys)
@keystead Gate:Deterministic (No LLM)
Client:Exclusive Approver
CONNECTOR STORE & APP CATALOG

Pre-built Integrations & Sandboxes

Equip your Keystead gate with isolated connectors. Each integration executes within client memory boundaries and strictly adheres to local policy rules.

Bundled

Cloudflare DNSv1.4.0

Automate DNS record creation, deletion, and verification. Hardened with zone allowlists and auto-TTL enforcement.

Actions (3):
dns.add_recorddns.delete_recorddns.list_records
Secret: cloudflare_token
Bundled

OctoDNS Multi-Cloudv1.1.0

Manage AWS Route 53, NS1, Google Cloud DNS, Azure DNS, and DigitalOcean using octoDNS multi-provider drivers.

Actions (3):
dns.add_recorddns.delete_recorddns.list_records
Secret: route53_secret
Bundled

Postiz Social Mediav1.0.2

Publish verified posts to Instagram, LinkedIn, X/Twitter, and TikTok via an isolated AGPL container.

Actions (2):
social.publish_postsocial.schedule_post
Secret: postiz_api_key
Official

GitHub Deployments & Releasesv2.0.0

Gate production environment releases, tag creations, and repository environment variable updates behind client approval.

Actions (3):
repo.create_releaseenv.approve_deploymentsecrets.update_repo
Secret: github_pat
Official

AWS STS Ephemeral Role Gatev1.2.0

Generates strictly scoped 15-minute temporary session tokens for S3 syncs or ECS tasks rather than sharing long-lived keys.

Actions (3):
aws.assume_roles3.sync_bucketecs.update_service
Secret: aws_iam_master
Official

Stripe Billing & Opsv1.0.1

Enables autonomous support agents to propose refunds, customer credit applications, or discounts with mandatory client sign-off.

Actions (3):
billing.create_couponbilling.refund_chargecustomer.verify
Secret: stripe_restricted_key
Official

Vercel Project & DNSv1.3.0

Safeguard production custom domains and preview aliases from being pointed to unapproved deployment hashes.

Actions (3):
domain.add_aliasdeployment.promote_proddomain.verify
Secret: vercel_token
Official

PostgreSQL / Neon Gatev1.0.4

Client-side query broker allowing AI agents to inspect schemas and propose safe schema migrations without exposing DB credentials.

Actions (3):
db.run_read_querydb.apply_migrationdb.describe_table
Secret: db_connection_string
POLICY ENGINE TESTBED

Deterministic Rule Evaluation

Rules in config/keystead.yaml match in sequence. The first matching rule wins, and anything unlisted resolves fail-closed.

Simulate Proposal Payload

JSON Parameters
Quick Test Templates:
Gate Evaluation ResultEFFECT: approve
Permitted Action: Queued for Human Client Approval

Allowlisted zone "clientsite.com" and permitted record type "TXT". Dispatched to client as approval card.

Rule Hierarchy (First Match Wins)Fallback: DEFAULT DENY
1
dns.list_records(Read-only action)
allow
2
dns.add_record(zone in [clientsite.com] AND type in [TXT, CNAME])
max 10/dayapprove
3
dns.delete_record(zone in [clientsite.com])
approve
4
social.publish_post(All verified social channels)
max 5/dayapprove
5
*(Catch-all wildcard)
deny
Evaluated in Pythonkeystead/policy.py
CRYPTOGRAPHIC THREAT MATRIX

Defenses Against Every Attack Vector

The side holding client credentials runs zero language models. Every threat is stopped deterministically.

Vector #1Zero-LLM Gate

Prompt Injection on Key-Holder

The gate has NO LLM. It parses pure JSON and evaluates YAML rules.

Enforced Fail-Closed
Vector #2Default Deny

Agency Agent Hijacked

Default-deny policy blocks unlisted actions; client sees the card before approving.

Enforced Fail-Closed
Vector #3Identity Pinning

Agent Types "approve KS-0001"

Only verified human participant IDs count. Agent approvals fail instantly.

Enforced Fail-Closed
Vector #4ID Binding

Client Display Name Spoofing

Sender IDs are pinned on first greeting. Different ID using same name is rejected.

Enforced Fail-Closed
Vector #5SHA-256 Hash

Proposal Swapped Post-Approval

Proposals are immutable in SQLite; approval is bound to SHA-256 payload_hash.

Enforced Fail-Closed
Vector #6Atomic CAS

Replay of Expired Approval

Each proposal has a 30-minute TTL and atomic CAS execution once only.

Enforced Fail-Closed
Vector #7Vault Redaction

Secret Leak in Chat or Logs

AES-256-GCM vault; automatic string and pattern redaction on all outbound messages.

Enforced Fail-Closed
Vector #8Protocol Guard

Switch "On Behalf Of" Spoof

Messages with sender_kind: platform or on_behalf_of are strictly rejected.

Enforced Fail-Closed
Vector #9Hash Ledger

Ledger Manipulation

Tamper-evident SHA-256 hash chain. keystead audit verify detects any alteration.

Enforced Fail-Closed

10-Minute Setup Guide

Deploy Keystead on the client machine and connect to Switch Console.

Terminal Setup
# 1. Clone & install
git clone https://github.com/DikshantJangra/KeyStead.git && cd KeyStead
uv sync

# 2. Initialize configuration and AES-256 master key
uv run keystead init

# 3. Store client credentials securely in vault
uv run keystead secret set cloudflare_token

# 4. Register gate as always-on agent in Switch Console
uv run keystead register

# 5. Run the gate
uv run keystead run