Inspiration
Autonomous AI coding agents can read repositories, run shell commands, and access environment variables—making them prime targets for indirect prompt injections hidden inside untrusted READMEs, issues, or web pages. Pure cloud security proxies add unacceptable latency to every tool call, while pure on-device rules lack the deep semantic reasoning needed to detect obfuscated social engineering. We built Airlock to combine instant local enforcement with deep cloud intent analysis.
What it does
Airlock is a zero-latency hybrid security firewall that sits between an autonomous AI agent and its execution environment:
- Local Gatekeeper & Secret Vaulting (On-Device): Intercepts every agent tool call in milliseconds to enforce deterministic security policies, redact/vault sensitive API keys and
.envcredentials, and run fast on-device checks via Firebase AI Logic Hybrid Inference. - Cloud Intent Provenance Layer (Gemini 2.0 Flash): When an agent command is ambiguous or originates from untrusted external context, Airlock seamlessly escalates to Gemini 2.0 Flash in the cloud to analyze intent provenance and detect hidden indirect prompt injections.
- Self-Learning Security Flywheel: Whenever the cloud model identifies a novel attack pattern, Airlock compiles that insight back into a deterministic rule for the local gatekeeper—turning future occurrences of the same attack into instant, zero-cost on-device blocks.
- Cryptographic Audit Chain & Live Dashboard: Every intercepted action, block, and escalation is recorded in an immutable SHA-256 hash chain and visualized in a real-time web monitoring dashboard complete with automated attack simulation demos.
How we used Firebase AI Logic (Hybrid Inference)
Airlock relies on Firebase AI Logic's Hybrid Inference SDK as its core decision router:
- On-Device First: Routine command classifications and local policy checks execute directly on-device with zero network round-trips and full privacy.
- Automatic Cloud Fallback: When local model capacity is unavailable on the host device or when a prompt's risk score crosses our ambiguity threshold, Firebase AI Logic automatically routes the inspection payload to Gemini 2.0 Flash in the cloud.
- Closed-Loop Rule Compilation: Cloud verdicts feed back into our local rule engine so the on-device layer gets smarter over time.
How we built it
- Local Gatekeeper & Vault: Python-based execution proxy handling tool interception, credential masking, and SHA-256 cryptographic ledger logging.
- Hybrid AI Layer: Integrated Firebase AI Logic Hybrid Inference in the web client to orchestrate on-device Gemini Nano execution alongside cloud Gemini 2.0 Flash provenance analysis.
- Monitoring Dashboard: Interactive web UI featuring live telemetry, cryptographic log verification, and one-click demo scenarios (benign coding task vs. indirect prompt injection exfiltration).
Challenges we ran into
- Balancing Latency vs. Security Depth: Checking every single file read or terminal command in the cloud slowed down agent workflows. Routing deterministic checks and initial triage locally while reserving cloud calls strictly for high-risk or ambiguous provenance reduced average overhead to near zero.
- Preventing Policy Bypass via Obfuscation: Attackers often encode exfiltration commands (e.g., Base64 or split strings). Combining local vaulting (so the agent never sees raw secrets in the first place) with cloud semantic reasoning closed both syntactic and semantic bypass vectors.
Accomplishments that we're proud of
- Building a self-learning defense flywheel where cloud intelligence continuously upgrades local, offline protection.
- Creating a verifiable SHA-256 audit trail that proves exactly why an autonomous agent action was allowed or blocked.
What's next for Airlock
- Expanding native wrappers for popular CLI coding agents and MCP (Model Context Protocol) tool servers.
- Adding community-signed threat rule feeds so developers can share compiled local firewall signatures safely.
Built With
- ai-security
- firebase
- gemini
- gemini-flash
- gemini-nano
- hybrid-ai
- javascript
- python
- sha-256