Zero-Trust ArchitectureDefense-in-Depth Specification

Security Architecture & Threat Model

SICTACK is a deterministic security middleware operating at the execution boundary between autonomous AI agents and underlying system tools. This document provides a transparent, verifiable breakdown of its threat model, cryptographic audit trails, approval replay defenses, and boundary guarantees.

Threat Model & Trust Boundaries

SICTACK treats the Large Language Model (LLM) as an untrusted reasoning engine. Regardless of how well an agent is prompt-engineered, an LLM remains vulnerable to prompt injection, hallucination, goal drift, and prompt manipulation. Therefore, an LLM is never permitted to make its own authorization decisions or alter security constraints.

Trust Boundary Principles

UNTRUSTED ZONE

Natural-language prompts, user inputs, external documents, web search results, and raw LLM output tokens.

TRUSTED ZONE

Signed policies, verified API keys, immutable IntentContext, operator approval nonces, and the deterministic 8-stage interception engine.

The execution boundary is placed between the tool call request emitted by the agent and the real Python callable or downstream REST endpoint. If an action does not pass deterministic evaluation, it is stopped dead before touching system memory, filesystems, databases, or APIs.

In-Process SDK vs Remote Authorization Gateway

SICTACK provides two complementary integration architectures depending on your runtime latency, infrastructure requirements, and centralized governance needs:

IN-PROCESS ENFORCEMENTSecureAgent

Runs entirely within the Python agent process. Tool callables are encapsulated inside a private closure registry (ToolRegistry). The agent runtime never receives direct references to the unshielded callable.

  • Sub-millisecond policy evaluation overhead (< 0.5ms).
  • Zero external network dependencies.
  • In-memory thread-safe approval manager (ApprovalService).
  • Best for local agents, CLI scripts, and offline development.
REMOTE GATEWAYSictackClient

Routes all interception requests over HTTPS to the centralized FastAPI backend (POST /api/v1/intercept).

  • Centralized organization-wide policy management.
  • Persistent PostgreSQL database with human approval queues.
  • Cryptographic SHA-256 sequential audit trail.
  • SOC dashboard telemetry and real-time threat detection.

Deterministic 8-Stage Policy Pipeline

Every tool invocation sent to POST /api/v1/intercept passes through an authoritative 8-stage verification pipeline in strict sequential order. If any stage denies or requires approval, evaluation short-circuits immediately:

Stage 1

Tenant & Agent Identity Verification

Validates API key/JWT, checks active organization membership, and updates agent heartbeat.

Stage 2

Intent Context Resolution

Verifies whether the supplied intent_id exists, belongs to the tenant, is ACTIVE, and has not expired.

Stage 3

Explicit Allow & Deny Filtering

Denies any tool in denied_permissions or lacking required permission in allowed_permissions.

Stage 4

Sensitivity Ceiling Enforcement

Compares tool sensitivity score against the policy max_sensitivity and intent sensitivity_ceiling.

Stage 5

Recipient & Exfiltration Boundaries

Enforces wildcard domain matching (*@company.com) on external communications tools.

Stage 6

Resource Scope Glob Confinement

Evaluates resource_id against authorized resource patterns (e.g., reports/*) to prevent directory traversal.

Stage 7

Atomic Human Approval Nonce Verification

If approval_id is provided, validates that the single-use token was approved, unexpired, unconsumed, and matches the action hash.

Stage 8

Tamper-Evident Audit Recording

Appends the decision to the organization's SHA-256 sequential hash chain before returning.

Intent-Scoped Authorization (IntentContext)

In standard RBAC, permissions are tied permanently to an agent identity. If an agent is granted db:write, it retains that power indefinitely. SICTACK 1.0 introduces Intent-Scoped Authorization:

How IntentContext Works

  1. Pre-Authorization by Trusted App: Before dispatching an agent task, your application creates an IntentContext with an explicit authorized_objective, allowed actions list, and expiration_timestamp (e.g., 10 minutes).
  2. Execution Context Binding: The agent receives the intent_id and includes it with every tool call.
  3. Boundary Enforcement: The security engine verifies that the tool call falls strictly within the bounds granted for that specific task.
  4. Immutability & Revocation: Once provisioned, an intent cannot be broadened by the agent. If an operator revokes an intent via POST /api/v1/intents/{id}/revoke, subsequent agent calls fail closed with DENY.

Human Approval & Cryptographic Replay Defense

When a high-risk tool call triggers REQUIRE_APPROVAL, SICTACK issues an approval request bound to an action hash. The approval token cannot be stolen, reused, or modified:

Action Hash Binding

The approval ticket stores action_hash = sha256(canonical(tool_name, arguments, agent_id)). If an attacker tampers with even one argument after approval, execution is rejected with HTTP 400 (ApprovalMismatchError).

Single-Use Atomic Nonce

Approvals are atomic single-use tokens. On redemption, the database marks consumed = true in a row-locked transaction. Any secondary attempt triggers HTTP 409 Conflict (ApprovalReplayError).

Strict TTL Expiration

Each approval has an expires_at timestamp (default 300 seconds). Approvals not claimed within the window are automatically invalidated with HTTP 410 Gone (ApprovalExpiredError).

Cryptographic SHA-256 Audit Chaining

SICTACK eliminates blind spots and prevents retroactive audit manipulation using a sequential SHA-256 hash chain inspired by blockchain ledger verification:

app/core/audit_chain.py
# Canonical Entry Hash Formula (app/core/audit_chain.py)
payload = f"{sequence_number}|{previous_hash}|{org_id}|{agent_id}|{tool_name}|{verdict}|{action_hash}|{timestamp_epoch}"
entry_hash = hashlib.sha256(payload.encode("utf-8")).hexdigest()

How Audit Integrity Is Guaranteed

  • Monotonic Sequence Numbers: Each tenant maintains an ordered sequence of events (sequence_number 1, 2, 3...).
  • Genesis Block: The first record in an organization chain links to a 64-character zero-hash (0000000000000000000000000000000000000000000000000000000000000000).
  • Linkage: Every subsequent record stores previous_hash equal to the preceding record's entry_hash.
  • Tamper-Evident Detection: If any database row is altered, inserted out-of-order, or deleted, every downstream hash in the chain breaks immediately.

You can verify your organization's audit trail at any time using the cryptographic verification endpoint:

Audit Verification Request
# Verify the cryptographic hash chain for your tenant
curl -X GET "YOUR_SICTACK_API_URL/api/v1/audit/verify" \
  -H "Authorization: Bearer <your-jwt-token>" \
  -H "X-Organization-ID: org-enterprise-alpha"
Verification Response
{
  "verified": true,
  "total_records": 1284,
  "valid_records": 1284,
  "corrupted_records": 0,
  "first_corrupted_id": null,
  "details": "Audit chain integrity verified. All sequential hashes match."
}

Authentication, RBAC & Tenant Scoping

Authentication Protocols

Agent M2M API Keys

Header: X-API-Key: ilk_live_.... Scoped exclusively to the Interception Gateway for machine-to-machine agents.

Operator JWT Tokens

Header: Authorization: Bearer <jwt>. Issued upon login containing signed claims for sub, org_id, and role.

Authoritative RBAC Roles

ADMIN

Full management: create/update policies, issue API keys, manage organization members, and inspect all audit logs.

OPERATOR

Operational control: triage and approve/reject pending approval requests, review alerts, and query audit events.

VIEWER

Read-only monitoring: inspect dashboard telemetry, view audit events, and run verification probes.

Organization Scoping

All database entities (policies, agents, approvals, audit events, intents) carry an org_id column. Backend database queries filter strictly by the authenticated tenant context (TenantContext.org_id). In addition, PostgreSQL Row Level Security (RLS) is enabled on all 12 core tables in Supabase.

Fail-Closed Behavior & Exception Hierarchy

SICTACK operates under strict fail-closed invariants: if anything goes wrong, permission is denied immediately.

Missing or Malformed Policy

If an agent is not mapped to an active policy, the interceptor logs POLICY_MISSING_FAIL_CLOSED and outputs DENY.

Unknown or Revoked Intent

If an intent context cannot be resolved for the active tenant, the call fails closed with INTENT_CONTEXT_NOT_FOUND.

Unhandled Server Errors

Top-level exception handlers intercept uncaught exceptions and return sanitized 500 errors without leaking internal stack traces or secrets.

Deterministic Typing

All SDK exceptions inherit from SictackError, allowing applications to reliably distinguish security denials from operational crashes.

Verified Controls vs Recommended Future Protections

To maintain engineering integrity, we explicitly distinguish controls verified by automated test suites from recommended future enterprise enhancements:

CapabilityCurrent StatusImplementation Mechanism
SHA-256 Sequential Audit ChainingVERIFIEDCryptographic hash chain validated by test_api_audit.py and GET /api/v1/audit/verify.
Single-Use Approval Replay ProtectionVERIFIEDAtomic database transaction locking with SHA-256 action hash validation in POST /api/v1/intercept.
Deterministic 8-Stage Policy EvaluationVERIFIEDPure Python policy engine (PolicyEngine) tested across 27+ automated test suites.
Supabase PostgreSQL RLS & API HardeningVERIFIEDMigration 2 enables RLS and revokes public PostgREST grants on 12 application tables and sequences.
Hardware Security Module (HSM) Key StorageRECOMMENDEDFuture enterprise roadmap item. Keys are currently stored as salted bcrypt hashes in PostgreSQL.
Per-Tenant Database Schema IsolationRECOMMENDEDMulti-tenancy currently relies on tenant_id column scoping and API dependency filtering.

Known Limitations & Unsupported Guarantees

SICTACK is designed with uncompromising technical honesty. We do not make unsupported marketing claims:

Non-Goal: Natural-Language Prompt Injection Cleansing

SICTACK does not claim to detect or clean prompt injections in user prompts or LLM output tokens. Prompt injection defense is an unresolved natural-language problem. Instead, SICTACK guarantees that even if an agent is 100% jailbroken or subverted, it cannot execute unauthorized tools, breach sensitivity ceilings, or exfiltrate data to disallowed recipients at the execution boundary.

Tenant Isolation Scope Notice

Multi-tenant isolation is enforced at the API layer via X-Organization-ID headers and application query filters. While PostgreSQL RLS is enabled on tables via Migration 2, backend services connecting with the database owner or service_role bypass RLS. Universal database-level isolation across direct unauthenticated connections is not guaranteed.

Model Context Protocol (MCP) Boundary Notice

The MCPSecurityProxy intercepts JSON-RPC 2.0 tools/call and tools/list messages. It does not inspect raw TCP sockets, lower-level transport stream vulnerabilities, or non-standard custom protocol extensions outside the MCP specification.

Commercial Release Blockers Register (Pre-Production Disclosures)

SICTACK maintains an explicit Commercial Blockers Register. The following security items are tracked and must not be misrepresented as fully production-hardened:

  • BLK-001 (PostgreSQL RLS): Local suites evaluate against SQLite. PostgreSQL Row-Level Security and multi-tenant connection pooling require production database staging.
  • BLK-002 (Transport-Level DNS Rebinding): Pre-flight DNS checks block private/metadata IPs, but socket-level pinning at the TCP transport layer is not enforced on Windows.
  • BLK-003 (Linux Kernel Isolation): LINUX_SANDBOX fails closed on Windows hosts (RuntimeIsolationUnavailableError); kernel namespace testing is pending a native Linux runner.
  • BLK-004 (PyPI Signing & Attestation): Wheels are built and tested locally; public PyPI publication and cryptographic key attestation are deferred.
  • BLK-005 (Distributed State Synchronization): Threat sessions and sliding windows are maintained in memory; multi-worker Redis cluster coordination is pending.

*Note: Phase 4D full regression verification is formally recorded as IMPLEMENTED / VERIFICATION PENDING.