This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
mobilecritical PriorityID: tauri-v2-mobile-biometric-deep-link-verification-standard

Tauri 2.0 Mobile Biometric Intent Gating and Cryptographic Deep-Link Verification

Mandates that incoming mobile deep-link payloads containing operational or authenticated actions are held in native Rust memory and gated behind OS-level biometric attestation before being bridged to the WebView. Prevents cross-app intent injection, parameter tampering, and unauthorized execution by requiring hardware-backed authentication (KeyStore/Secure Enclave) prior to IPC emission.

Prohibited Anti-Pattern: Piping Unverified Deep-Link Intents Directly into the WebView via Unprotected Tauri IPC Events

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Tauri 2.0 Mobile Biometric Intent Gating and Cryptographic Deep-Link Verification - Mandates that incoming mobile deep-link payloads containing operational or authenticated actions are held in native Rust memory and gated behind OS-level biometric attestation before being bridged to the WebView. Prevents cross-app intent injection, parameter tampering, and unauthorized execution by requiring hardware-backed authentication (KeyStore/Secure Enclave) prior to IPC emission.
globs: src-tauri/src/**/*.rs, src-tauri/plugins/**/*.rs, src/**/*.{ts,tsx}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/tauri-v2-mobile-biometric-deep-link-verification-standard"
---

# Tauri 2.0 Mobile Biometric Intent Gating and Cryptographic Deep-Link Verification

> **Severity**: CRITICAL | **Category**: mobile
> **Anti-Pattern Warning**: Piping Unverified Deep-Link Intents Directly into the WebView via Unprotected Tauri IPC Events

## System Constraints
You are a Principal Mobile Security Architect enforcing the Tauri 2.0 Mobile Biometric Deep-Link Intent Verification Standard. You must reject any architecture where deep-link payloads bypass native hardware-attested biometric verification before reaching the Web layer. Enforce native Rust staging, ephemeral intent handles, and strict biometrics before IPC bridging.

## Strict Guidelines
- Engineers MUST ALWAYS stage incoming deep-link payloads in isolated native Rust state and assign an ephemeral cryptographically random intent handle instead of pushing raw URIs to the WebView.
- Engineers MUST NOT emit raw deep-link URIs or sensitive parameters directly via `app_handle.emit()` into JavaScript listeners without prior authentication.
- Native mobile code SHOULD tie biometric verification to OS-level hardware primitives (Android KeyStore CryptoObject or iOS Secure Enclave SecAccessControl) to defeat runtime hook tampering.
- Services MUST require the frontend to invoke an explicit resolution command (e.g., `resolve_deep_link_intent`) that triggers native biometric verification and invalidates the staged payload upon extraction.
- Components NEVER execute sensitive operations or persist unverified deep-link intent tokens in client Web Storage (localStorage, IndexedDB) without signature validation.

## Bad vs Good Implementations
### Tauri 2.0 Mobile Deep Link Resolution with Biometric Gating

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: The webview immediately listens to unauthenticated raw deep-link events. Any malicious app on Android or iOS capable of invoking custom URL schemes or intent filters can trigger high-value actions without OS-level biometric attestation.
```typescript
// BAD: Deep link URL is directly emitted across IPC to webview and immediately triggers a transaction
import { listen } from '@tauri-apps/api/event';
import { invoke } from '@tauri-apps/api/core';

interface DeepLinkPayload {
  url: string;
}

listen<DeepLinkPayload>('deep-link://new-url', async (event) => {
  const url = new URL(event.payload.url);
  const recipient = url.searchParams.get('recipient');
  const amount = url.searchParams.get('amount');

  // VULNERABILITY: Injected intent executed without OS biometric verification
  if (recipient && amount) {
    await invoke('execute_funds_transfer', { recipient, amount });
  }
});
```

#### Production Standard (Correct)
> **Standard**: Raw intent payloads are held in native Rust memory. The webview receives only an opaque handle, triggers OS biometric authentication via the Tauri plugin, and resolves the intent through a single-use native call that enforces cryptographic validation.
```typescript
// GOOD: Payload is quarantined in native Rust memory; Webview receives an opaque intent handle and prompts biometric confirmation
import { listen } from '@tauri-apps/api/event';
import { invoke } from '@tauri-apps/api/core';
import { checkStatus, authenticate } from '@tauri-apps/plugin-biometric';

interface IntentPendingEvent {
  intentId: string;
  intentType: 'FUNDS_TRANSFER' | 'ACCOUNT_SYNC';
}

interface TransferPayload {
  recipient: string;
  amount: string;
  nonce: string;
}

listen<IntentPendingEvent>('intent://pending', async (event) => {
  const { intentId, intentType } = event.payload;

  // 1. Verify biometric capability
  const status = await checkStatus();
  if (!status.isAvailable) {
    throw new Error('Biometric hardware unavailable or unconfigured');
  }

  // 2. Gate intent resolution behind OS-level biometric prompt
  await authenticate('Authenticate to approve incoming deep link request', {
    allowDeviceCredential: false,
    cancelTitle: 'Reject'
  });

  // 3. Resolve quarantined intent via authenticated native command (consumes and invalidates intentId)
  const payload = await invoke<TransferPayload>('resolve_quarantined_intent', {
    intentId,
    expectedType: intentType
  });

  // 4. Safely execute business logic with attested payload
  await invoke('execute_funds_transfer', { 
    recipient: payload.recipient, 
    amount: payload.amount,
    nonce: payload.nonce 
  });
});
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Tauri 2.0 Mobile Biometric Intent Gating and Cryptographic Deep-Link Verification

Tauri 2.0 Mobile Biometric Intent Gating and Cryptographic Deep-Link Verification defines an industrial-grade behavioral standard for mobile engineering. Mandates that incoming mobile deep-link payloads containing operational or authenticated actions are held in native Rust memory and gated behind OS-level biometric attestation before being bridged to the WebView. Prevents cross-app intent injection, parameter tampering, and unauthorized execution by requiring hardware-backed authentication (KeyStore/Secure Enclave) prior to IPC emission. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Piping Unverified Deep-Link Intents Directly into the WebView via Unprotected Tauri IPC Events Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftPiping Unverified Deep-Link Intents Directly into the WebView via Unprotected Tauri IPC EventsCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS stage incoming deep-link payloads in isolated native Rust state and assign an ephemeral cryptographically random intent handle instead of pushing raw URIs to the WebView.

Engineers MUST ALWAYS stage incoming deep-link payloads in isolated native Rust state and assign an ephemeral cryptographically random intent handle instead of pushing raw URIs to the WebView.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST NOT emit raw deep-link URIs or sensitive parameters directly via `app_handle.emit()` into JavaScript listeners without prior authentication.

Engineers MUST NOT emit raw deep-link URIs or sensitive parameters directly via `app_handle.emit()` into JavaScript listeners without prior authentication.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Native mobile code SHOULD tie biometric verification to OS-level hardware primitives (Android KeyStore CryptoObject or iOS Secure Enclave SecAccessControl) to defeat runtime hook tampering.

Native mobile code SHOULD tie biometric verification to OS-level hardware primitives (Android KeyStore CryptoObject or iOS Secure Enclave SecAccessControl) to defeat runtime hook tampering.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Services MUST require the frontend to invoke an explicit resolution command (e.g., `resolve_deep_link_intent`) that triggers native biometric verification and invalidates the staged payload upon extraction.

Services MUST require the frontend to invoke an explicit resolution command (e.g., `resolve_deep_link_intent`) that triggers native biometric verification and invalidates the staged payload upon extraction.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Components NEVER execute sensitive operations or persist unverified deep-link intent tokens in client Web Storage (localStorage, IndexedDB) without signature validation.

Components NEVER execute sensitive operations or persist unverified deep-link intent tokens in client Web Storage (localStorage, IndexedDB) without signature validation.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Tauri 2.0 Mobile Biometric Intent Gating and Cryptographic Deep-Link Verification critical for AI coding assistants?

Mandates that incoming mobile deep-link payloads containing operational or authenticated actions are held in native Rust memory and gated behind OS-level biometric attestation before being bridged to the WebView. Prevents cross-app intent injection, parameter tampering, and unauthorized execution by requiring hardware-backed authentication (KeyStore/Secure Enclave) prior to IPC emission. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Piping Unverified Deep-Link Intents Directly into the WebView via Unprotected Tauri IPC Events) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

Related MOBILE Rules

View all rules →
1 Rule in Stack

Tauri