SECURITY ENGINE 01 // IN-PROCESS GATEWAY

SICTACK CORE Deterministic Gateway

In-depth developer reference for deterministic tool authorization, parameter constraints, policy version binding, and cryptographic audit trails.

CORE Engine Overview

SICTACK CORE is the deterministic pre-execution enforcement gateway for autonomous AI agents. Unlike probabilistic LLM guardrails that rely on prompt evaluation, CORE executes inside the local agent process before any tool handler, network request, or shell process is dispatched.

Every tool invocation is evaluated against mathematical constraints in under 1.0 millisecond, guaranteeing strict default-deny enforcement, parameter boundary validation, and immutable audit logging.

Zero-Bypass Architecture
CORE acts as an authoritative boundary. Even if an LLM is compromised via indirect prompt injection, jailbreaking, or token smuggling, the underlying tool call cannot execute if it violates the declared policy constraints.

Parameter-Level Constraints

Standard RBAC permissions only answer “Can this agent execute tool X?”. CORE parameter constraints answer “Can this agent execute tool X with these specific parameters?”.

Constraint KeyTypeDescription
max_numericfloat / intMaximum allowable numeric threshold for the argument.
min_numericfloat / intMinimum allowable numeric threshold for the argument.
allowed_valueslist[str]Whitelist of permitted string enum values.
forbidden_patternslist[regex]Regex patterns that trigger immediate denial if matched.
models.py
from sictack.models import Policy

# Declare policy with parameter constraints
policy = Policy(
    id="pol_fintech_transfers",
    name="Wire Transfer Security Policy",
    version=2,  # Monotonically increasing version
    allowed_permissions=["bank:transfer", "db:read"],
    parameter_constraints={
        "amount_usd": {
            "min_numeric": 1.0,
            "max_numeric": 10000.0,
        },
        "currency": {
            "allowed_values": ["USD", "EUR", "GBP"],
        },
        "recipient_iban": {
            "forbidden_patterns": ["^RU.*", "^IR.*", "^KP.*"],
        },
    },
)

Policy Version Binding

To prevent race conditions during policy deployments, SICTACK binds every authorization decision to the active version of the policy.

If an approval request is generated under Policy v1, but an administrator updates the policy to Policy v2 before the approval is granted, executing the stale approval triggers a PolicyVersionMismatchError. The agent is forced to re-evaluate intent under the latest policy rules.

Decision TTL & Expiration

All decisions and approval requests contain an immutable expires_at UNIX timestamp. By default, approvals are valid for 300 seconds (5 minutes). Any delayed execution attempt after the TTL has expired is halted immediately with an AuthorizationExpiredError.

Canonical Argument Hashing

Tool arguments undergo deterministic canonicalization before hashing: keys are lexicographically sorted, whitespace is normalized, and numeric precision is standardized. The resulting SHA-256 digest (action_hash) ensures that human approvers authorize the exact arguments executed downstream.

Multi-Agent Delegated Authorization

Modern enterprise AI fleets operate as multi-agent graphs where a supervisor orchestrates specialized workers (e.g., LangGraph supervisors, AutoGen fleets, CrewAI crews). SICTACK CORE provides mathematical, least-privilege delegation boundaries across the agent hierarchy.

Least-Privilege Bounds

Child agent capability is strictly bounded by the mathematical intersection: Parent Policy ∩ Delegation Token ∩ Child Policy. A child can never exceed its parent’s scope.

Confused-Deputy Defense

Delegation tokens bind cryptographically to child_agent_id with HMAC-SHA256 signatures. If a rogue agent attempts to replay or present another agent’s token, CORE rejects execution with ConfusedDeputyError.

Budget & Depth Controls

Tokens enforce bounded execution budgets (tool call counts) and maximum hierarchy depths (preventing unbounded recursive agent spawning loops).

delegation_security.py
from sictack.unified import Sictack
from sictack.models import Policy
from sictack.exceptions import (
    DelegationPrivilegeEscalationError,
    ConfusedDeputyError,
    DelegationExpiredError,
)

security = Sictack(signing_key="enterprise-secret-key")

# 1. Supervisor issues scoped, cryptographically-signed token to worker
token = security.delegate(
    parent_agent_id="supervisor-agent",
    child_agent_id="researcher-agent",
    allowed_capabilities=["research:read", "compute:add"],
    allocated_budget=50,
    ttl_seconds=300,  # 5-minute lifespan
)
print("Delegation Token Issued:", token.delegation_id)
print("Cryptographic HMAC-SHA256 Signature:", token.signature)

# 2. Worker executes tool within delegated capability boundaries
with security.task(
    agent_id="researcher-agent",
    delegation_token=token,
    intent="Query customer telemetry",
):
    result = security.execute_tool("query_knowledge_base", {"query": "Zero Trust"})
    print("Execution Permitted:", result)

# 3. Privilege Escalation Prevention: Worker cannot exceed parent capability scope
try:
    with security.task(agent_id="researcher-agent", delegation_token=token):
        # Even if child agent attempts root-level admin actions:
        security.execute_tool("admin_purge_database", {"scope": "all"})
except DelegationPrivilegeEscalationError as err:
    print("Halted: Privilege Escalation Attempt Blocked:", err)

# 4. Confused-Deputy Defense: Token stolen by a different agent is immediately rejected
try:
    with security.task(agent_id="malicious-rogue-agent", delegation_token=token):
        security.execute_tool("query_knowledge_base", {"query": "Exfiltrate"})
except ConfusedDeputyError as err:
    print("Halted: Confused Deputy Attack Prevented:", err)

Full Python SDK Implementation

Here is a complete end-to-end example configuring parameter constraints and handling runtime decisions:

agent_security.py
from sictack import SecureAgent, ToolCall, Config
from sictack.exceptions import PermissionDeniedError, PolicyVersionMismatchError, AuthorizationExpiredError

# 1. Initialize SecureAgent with hardened policy
agent = SecureAgent(
    agent_id="fintech_operator_01",
    permissions=["bank:transfer"],
    config=Config(
        policy=policy,
        decision_ttl_seconds=300,  # Approvals expire in 5 minutes
    ),
)

# 2. Register tool handler
@agent.register_tool(name="execute_transfer", permission="bank:transfer")
def transfer_handler(amount_usd: float, currency: str, recipient_iban: str) -> dict:
    return {"status": "SUCCESS", "tx_id": "tx_99210"}

# 3. Invocation within bounds -> ALLOW
call = ToolCall(
    tool_name="execute_transfer",
    arguments={
        "amount_usd": 450.0,
        "currency": "USD",
        "recipient_iban": "DE89370400440532013000",
    },
)
decision = agent.execute(call)
print("Execution Result:", decision)

# 4. Out-of-bounds invocation -> DENY (Exceeds max_numeric)
try:
    bad_call = ToolCall(
        tool_name="execute_transfer",
        arguments={
            "amount_usd": 50000.0,  # Exceeds max_numeric: 10000.0
            "currency": "USD",
            "recipient_iban": "DE89370400440532013000",
        },
    )
    agent.execute(bad_call)
except PermissionDeniedError as err:
    print("Blocked by CORE Policy Engine:", err)
    # >>> Blocked by CORE Policy Engine: Parameter 'amount_usd' value 50000.0 exceeds maximum 10000.0