Documents
bypass-resistance
bypass-resistance
Type
External
Status
Published
Created
Mar 25, 2026
Updated
Mar 25, 2026

Bypass Resistance#

This page documents the evasion techniques pipelock handles and the ones it doesn't. Security reviewers: this is the honest picture.

How Scanning Works#

Every URL, tool argument, and response passes through a multi-layer pipeline. The order matters: DLP runs before DNS resolution (so secrets can't leak via DNS queries), and SSRF checks run after (so private IP detection works on resolved addresses).

Response scanning uses a 6-pass normalization pipeline. Each pass catches a different evasion class.

Encoding Evasion#

These techniques hide secrets or injection payloads inside encoded data.

TechniqueExampleStatusHow
Base64 (standard + URL-safe)c2stYW50LWFwaTA=TestedTries 4 base64 variants on every segment > 10 chars
Base32ONQW2YLUMVWGY3DPTestedDecoded and re-checked against DLP
Hex encoding736b2d616e742dTestedHex-decoded, case-insensitive
Delimiter-separated hex73:6b:2d:61:6e:74TestedStrips 6 delimiter formats (:, -, , ,, \x prefix, 0x prefix) before hex decode
URL encoding (multi-layer)%25%32%44 (5-10 layers deep)TestedIterativeDecode() runs up to 500 rounds
Mixed encoding chainsbase64(hex("secret"))TestedEach layer decoded, re-normalized, re-checked
Field-split encodingSecret spread across ?a=sk-&b=ant-&c=api03TestedQuery subsequence matching (ordered 2-4 param combos)

Unicode Evasion#

These techniques use Unicode characters to break pattern matching.

TechniqueExampleStatusHow
Zero-width characterssk\u200b-ant (ZW space in key)Tested16 Unicode ranges stripped before matching
NFKC normalization bypassfile (fi ligature)TestedNFKC decomposition applied to all scanned text
Homoglyphs (Cyrillic)аpi_kеy (Cyrillic a and e)Tested80+ confusable character mappings
Homoglyphs (Greek/Armenian/Cherokee)αpi, օverrideTestedExtended confusable map covers major scripts
Combining markse\u0306 (e + combining breve)TestedNFD decomposition then mark stripping
Control characterssk\x00-ant (null byte)TestedC0, C1, DEL all stripped before matching
Leetspeak1GN0R3 4LLTestedDigit-to-letter folding (response scanning)
Vowel substitutioninstrocktoonsTestedVowel folding pass in response scanning
Regional indicators / emojiBoxed letters, flag sequencesTestedStripped by zero-width/variation selector removal

DNS-Based Exfiltration#

These techniques leak data through DNS queries rather than HTTP bodies.

TechniqueExampleStatusHow
Secret in subdomainaGVsbG8.evil.comTestedSubdomain entropy check + DLP on hostname, pre-DNS
Secret split across labelssk-ant.AABB.CCDD.evil.comTestedDots stripped, labels concatenated before DLP
High-entropy subdomainsjk3n4k5n.evil.comTestedShannon entropy > 4.0 on labels > 8 chars
Subdomain rotationa.evil.com, b.evil.com, c.evil.comTestedRate limiting on base domain (last 2 labels)

Key design choice: DLP and subdomain entropy run at layers 3-4, before DNS resolution at layer 6. This means secrets are caught before any DNS query leaves the proxy.

Slow/Chunked Exfiltration#

These techniques exfiltrate data in small pieces over time.

TechniqueExampleStatusHow
Many small requests1 byte per request, 1000 requestsTestedPer-domain rate limiting (default 60/min)
Data budget exhaustionStay under rate limit, send lots of dataTestedPer-domain byte budget (sliding 60-second window)
Subdomain rotation for rate bypassDifferent subdomains to reset countersTestedRate limit keyed on base domain, not full hostname
Query parameter splitting?a=sk-&b=ant-&c=api03 across paramsTestedOrdered query subsequence matching (O(n^4), capped at 20 params)
Path segment splitting/sk-/ant-/api03/AAAA/evil.comTestedNoise stripping + ordered concatenation

Prompt Injection Evasion#

These techniques hide injection payloads in fetched content or MCP tool results.

TechniqueExampleStatusHow
Basic injection"Ignore all previous instructions"Tested21 built-in patterns, case-insensitive
Zero-width splittingignore\u200ball\u200bpreviousTestedPass 1: strip ZW chars
Word boundary collapseWords merged after ZW removalTestedPass 2: replace invisible with space, re-scan
Leetspeak substitution1GN0R3 4LL PR3V10USTestedPass 3: digit-to-letter folding
No-space concatenationignoreallpreviousinstructionsTestedPass 4: optional-whitespace pattern variants
Vowel confusioninstrocktoonsTestedPass 5: vowel folding (a,e,i,o,u mapped to same char)
Encoded injectionbase64("ignore all previous")TestedPass 6: base64/hex decode, re-normalize, re-scan
Homoglyph injectionіgnore (Cyrillic і)TestedConfusable mapping in normalization pipeline

MCP-Specific Evasion#

These techniques target the MCP proxy layer.

TechniqueExampleStatusHow
Tool description poisoningInjection in tool description textTestedDescription scanned through response pipeline
Rug-pull (mid-session drift)Tool description changes after first tools/listTestedSHA256 hash baseline per session
Cross-tool injectionTool A result injected into Tool B inputTestedAll text extracted from results and scanned
Encoded payload in tool resultbase64("override system prompt") in resultTestedDecoded and re-scanned
Shell obfuscation in argsr\m -rf, ${IFS}-rf, $'\x6d'TestedShell escape decoding before policy matching
Unknown tool executionServer returns tools not in initial inventoryTestedSession binding validates against baseline
JSON key exfiltrationSecret encoded as JSON object keyTestedBoth keys and values extracted from JSON
Batch response poisoningN clean + 1 injected response in batchTestedEach batch element scanned individually

Request Body and Header Evasion#

These techniques try to exfiltrate secrets through request bodies or headers instead of URLs.

TechniqueExampleStatusHow
Secret in POST body (JSON){"key": "sk-ant-..."}TestedRecursive JSON string extraction, DLP scan per field + joined
Secret in JSON object key{"AKIA1234...": "value"}TestedBoth keys and values extracted from JSON
Secret in form fieldtoken=sk-ant-...TestedForm-urlencoded parsed, keys + values scanned
Secret in multipart fieldFile upload form with secret in text fieldTestedMultipart text parts extracted, binary parts skipped
Secret in multipart filenameContent-Disposition: ...; filename="sk-ant-..."TestedFilenames extracted and scanned; oversized filenames blocked
Content-Type spoofingJSON body sent as application/octet-streamTestedUnknown types get fallback raw-text scan (never skipped)
Compressed body bypassgzip-encoded body to evade regex matchingTestedAny non-identity Content-Encoding is fail-closed blocked
Split secret across headersX-A: sk-ant- + X-B: api03-restTestedJoined scan concatenates all scanned header values
Split secret across nameX-AKIA1234: EXAMPLETestedHeader name + value concatenated and scanned (all mode)
Secret in Authorization headerBearer sk-ant-... to allowlisted hostTestedHeaders scanned regardless of destination (no allowlist skip)
Malformed form bodyInvalid urlencoded to trigger raw fallbackTestedFail-closed block on parse error (prevents parser differential)
Multipart boundary omissionmultipart/form-data without boundaryTestedFail-closed block (missing boundary)

Scope note: Request body and header scanning applies to forward HTTP proxy (absolute-URI requests), fetch handler headers, and intercepted CONNECT tunnels (when tls_interception.enabled is true). Unintercepted CONNECT tunnels carry TLS-encrypted traffic where bodies and headers are not visible.

Cross-Request Exfiltration#

These techniques spread secret data across multiple independent requests to stay below per-request detection thresholds.

TechniqueVariantStatusHow
Split secret across requestsA: one piece per URL/body/payload, separate requestsTestedFragment reassembly buffers outbound payloads (URLs, request bodies, MCP JSON-RPC payloads, WebSocket frames) per session, re-scans concatenated content against DLP
Encode-then-splitB: base64 the secret, split the encoded formTestedFragment buffer decodes reassembled content through the same multi-encoding pipeline as single-request DLP
Low-entropy dripC1: small pieces that individually look benignTestedEntropy budget tracks cumulative Shannon entropy per session across a sliding window. Exceeding the budget triggers the configured action.
Covert channel exfiltrationC2: timing, header ordering, HTTP/2 frame flagsNot coveredThese channels carry bits outside the URL/body content layer. Detecting them requires protocol-level analysis beyond content inspection. Documented gap.

Two detection mechanisms:

  • Entropy budget: tracks the cumulative information content (Shannon entropy bits) of all outbound payloads (URLs, request bodies, MCP JSON-RPC payloads, WebSocket frames) per session within a sliding time window. When total bits exceed the configured threshold (bits_per_window), the request triggers the configured action. This catches slow-drip exfiltration where each individual request looks clean.

  • Fragment reassembly: buffers outbound payloads (URLs, request bodies, MCP JSON-RPC payloads, WebSocket frames) per session using two independent streams: one for query parameter values, bare tokens, and body content, and another for query parameter names. Both streams are re-scanned against DLP patterns on every request (synchronous, pre-forward). When a concatenated buffer matches a DLP pattern, the completing request triggers the configured CEE action before it leaves. Buffer size is capped per session to prevent memory exhaustion.

Corroboration with adaptive enforcement: Both entropy budget and fragment DLP hits feed into the per-session adaptive enforcement score. An agent that triggers both signals (high cumulative entropy AND a fragment DLP match) escalates faster than one triggering either alone. This stacking makes it harder for an attacker to stay below all thresholds simultaneously.

Coverage gap: Cross-request detection scans all outbound content visible to the proxy: URLs, request bodies, MCP JSON-RPC payloads, and WebSocket frames. For CONNECT tunnels without TLS interception, only the target hostname is visible (not the request body or path). Enable tls_interception.enabled: true to get full cross-request coverage on CONNECT traffic.

Known Limitations#

These are things pipelock does not protect against. If your threat model includes these, you need additional controls.

Out of Scope#

LimitationWhyMitigation
Process-level attacksPipelock is a network proxy, not a sandbox. If the agent can exec arbitrary processes, those processes can bypass the proxy.Pair with an OS sandbox (Docker, gVisor, Firecracker). See comparison.
Non-HTTP exfiltrationAgent writes to cloud-synced folder, clipboard, stdout, or subprocess that doesn't use the proxy.Container network isolation (see deployment recipes).
Model compromiseIf the model itself is fine-tuned to be malicious, pipelock can't distinguish legitimate from malicious intent.Defense in depth. Pipelock catches the network-visible symptoms.
SteganographyData hidden in image pixels, timing channels, or LSBs of audio/video.Beyond content inspection. Requires specialized analysis.

Architectural Limits#

LimitationDetailImpact
Regex-based injection detectionInjection patterns are syntactic, not semantic. An LLM-crafted injection that doesn't match known patterns will pass.Add custom patterns for your domain. Future: pluggable detector interface.
CONNECT tunnel body blindnessWithout TLS interception, CONNECT tunnels carry end-to-end TLS where pipelock only sees the hostname.Enable tls_interception.enabled: true to decrypt, scan, and re-encrypt tunnel traffic. Bodies, headers, and responses are fully scanned. Domains that pin certificates can be excluded via passthrough_domains.
DNS rebinding TOCTOUHostname resolves to public IP at scan time, then to internal IP at connect time. Classic time-of-check/time-of-use race.DNS pinning mitigates most cases. For high-security: use strict mode (allowlist only).
Very slow exfiltration1 byte per hour over days. Below any practical rate limit or entropy threshold.Container isolation prevents this entirely. Without isolation, this is the residual risk.
ReDoS in custom patternsUser-supplied DLP or response patterns could have catastrophic backtracking. Built-in patterns are tested, but custom ones aren't analyzed for ReDoS.Test custom patterns before deploying.
HITL approval floodingAttacker generates many HITL prompts to overwhelm the human reviewer.Use block action instead of ask in unattended environments.

Operational Risks#

RiskDetailMitigation
MisconfigurationAudit mode logs but doesn't block. If an operator forgets to switch to balanced/strict, nothing is enforced.Start with balanced mode. Use pipelock audit . to generate a config tuned for your project.
Agent identity spoofingAny process that can reach pipelock can claim any agent name via X-Pipelock-Agent header or ?agent= query param.Use listener binding (dedicated ports per agent) for spoof-proof identity. Header/query methods trust the caller. Network isolation adds defense in depth.
IPv6 bypassIf internal CIDR list doesn't include IPv6 ranges, agents could reach internal services via IPv6. Zone IDs (e.g. ::1%eth0) could bypass net.ParseIP if not stripped.Default config includes ::1/128, fc00::/7, fe80::/10, 224.0.0.0/4 (IPv4 multicast), ff00::/8 (IPv6 multicast). Zone IDs are stripped before IP parsing.
MCP confused deputyA malicious MCP server sends JSON-RPC responses with IDs the client never used, hijacking the agent's execution flow.Response ID validation tracks outbound request IDs and rejects unsolicited responses. One-shot consumption prevents replay.

Testing Your Setup#

Pipelock ships with built-in test vectors. After configuring, verify:

# Should be BLOCKED (DLP catches the fake key)
pipelock check --config pipelock.yaml --url "https://example.com/?key=sk-ant-api03-fake1234567890"

# Should be BLOCKED (domain blocklist)
pipelock check --config pipelock.yaml --url "https://pastebin.com/raw/abc123"

# Should be ALLOWED (clean URL)
pipelock check --config pipelock.yaml --url "https://docs.python.org/3/"

# Validate scanning coverage with test vectors
pipelock test --config pipelock.yaml --fail-on-gap

For production deployments, also test from within your isolation layer (Docker, K8s, iptables) to verify the agent cannot bypass pipelock entirely.