Routing Private Agent Inference via Secure Enclaves and Open-Weight Models
Security engineer Micah Lee outlines a practical playbook for replacing OpenAI and Anthropic with open-weight models like GLM-5.3 and Mistral Large. Developers can route unmonitored agent tasks through confidential enclaves on Tinfoil or Maple AI.

Why it matters
Run security audits, reverse engineering, and proprietary codebase queries through confidential computing enclaves without vendor surveillance or session policy blocks.
TL;DR
- 01Open-weight GLM-5.3 offers software engineering performance rivaling Claude Opus 5.5 without guardrail refusals.
- 02Tinfoil provides confidential computing enclaves with hardware attestation starting at $1.80/1M input tokens.
- 03Avoid proprietary harness clients like ZCode, which was observed exfiltrating local source code to external servers.
Key facts
- Tinfoil GLM-5.3 Input Rate
- $1.80 per 1M input tokens
- Tinfoil Prompt Cache Rate
- $0.80 per 1M cached tokens
- Tinfoil Output Rate
- $5.75 per 1M generated tokens
- Maple AI Consumer Pricing
- Free plan available; Pro subscription at $20/month
- OpenCode Go Retain Policy
- Zero-day retention for GLM, Qwen, Kimi, and DeepSeek models
- Open-Weight Lead Lag
- Approximately 4 months behind proprietary frontier models
Breaking Free from Vendor Surveillance
Proprietary frontier models continuously inspect user prompts for policy violations, creating severe hurdles for vulnerability research, exploit testing, and confidential enterprise development. OpenAI and Anthropic gate unrestricted cybersecurity access behind closed vetting programs. Open-weight models, however, are now within four months of proprietary capabilities. Independent testing indicates that GLM-5.3 matches Claude Opus 5.5 in software engineering tasks, while Mistral Large 4 and GLM-5.3-Flash deliver high-throughput alternatives.
Confidential Computing with Remote Attestation
Rather than procuring expensive on-premise hardware like a Mac Studio with 512 GB of RAM, developers can use confidential computing enclaves to achieve cryptographic privacy:
- Tinfoil: Leverages secure hardware enclaves with remote attestation to ensure cloud providers cannot inspect execution state or prompts. GLM-5.3 costs $1.80 per 1M input tokens, $0.80 per 1M cached tokens, and $5.75 per 1M output tokens.
- Maple AI: Built on Tinfoil's backend infrastructure for interactive chatbot workloads, offering a free tier alongside a $20/month Pro plan.
- OpenCode Go: Offers a budget-oriented $10/month multi-model routing layer with documented zero-day retention for GLM, Qwen, Kimi, and DeepSeek families.
Client Harness Telemetry Risks
While open-weight model architectures are safe to deploy in secure pipelines, developer harnesses provided by model vendors often present distinct security threats. For instance, the ZCode CLI agent from Z.ai was recently observed silently uploading local source repositories to remote Alibaba Cloud instances without user permission. Engineers must decouple model execution from vendor-controlled agent binaries, directing trusted IDE extensions to enclave-backed OpenAI-compatible endpoints.
Try it in 2 minutes
# Connect Cursor or Claude Code-compatible tooling to private Tinfoil enclave endpoints
export OPENAI_BASE_URL="https://api.tinfoil.sh/v1"
export OPENAI_API_KEY="$TINFOIL_API_KEY"
curl -s "$OPENAI_BASE_URL/chat/completions" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"reasoning_effort": "low",
"messages": [{"role": "user", "content": "Analyze this smart contract for reentrancy bugs."}]
}'bash
✓ When to use
- When performing vulnerability audits, malware reverse engineering, or penetration tests that trigger false guardrails.
- When building agent pipelines on proprietary repositories that must never leave a secure hardware boundary.
✕ When NOT to use
- When your organization already holds enterprise compliance and zero-retention contracts with Anthropic or OpenAI.
- When low-latency multimodal speech and vision features are strictly required in the same pipeline.
What to do today
- Switch sensitive security testing prompts from standard APIs to an enclave-backed private endpoint.
- Audit development environments and uninstall untrusted vendor harnesses like ZCode.
- Configure OpenAI-compatible IDE tools to use Tinfoil API keys with lower reasoning parameters to cut token costs.
What the community says
“I'm concerned our media / political ecosystem is too dysfunctional to not repeat the mistakes we made with Big Tech & Social again with Big Ai. I find it curious how split the dev community is”
“Everything's a grift to our current leaders and media. The specifics are wholly irrelevant and replaceable. crypto, AI, it's buzzwords and the important thing is how much money they can make”