Diagnostics & FAQsSelf-Service Resolution

Troubleshooting & Diagnostics Guide

Resolve common installation issues, authentication errors, approval lifecycle mismatches, framework adapter behaviors, and build-time filesystem quirks safely and predictably.

SDK Installation & Python Environment Issues

ERROR: Package 'sictack' requires a different Python: <version> not in '>=3.12'

Root Cause: You are installing or executing with Python ≤ 3.11. SICTACK specifies requires-python = ">=3.12" in pyproject.toml.

Fix: Upgrade your runtime environment to Python 3.12 or newer. Verify your active version with python --version.

ModuleNotFoundError: No module named 'sictack'

Root Cause: The SDK package is not installed in the active virtual environment.

Fix: Install in editable mode from your local checkout:

Terminal
pip install -e /path/to/SICTACK_SDK/sdk/python
AttributeError: module 'sictack' has no attribute 'SecureAgent'

Root Cause: Import Shadowing. A file or directory in your current working directory is named sictack.py or sictack/, intercepting the real package.

Diagnose Import Shadowing
# How import shadowing occurs
# If your project directory contains a file named 'sictack.py'':
import sictack  # Fails or loads the empty local file instead of the package!

# Solution:
# 1. Rename any local script named sictack.py to test_agent.py or run_defense.py
# 2. Check the resolved module path:
python -c "import sictack; print(sictack.__file__)"
# Correct output: .../site-packages/sictack/__init__.py

Windows OneDrive EPERM -4048 Build Lock

Forensic Diagnosis for Windows Users

When building Next.js projects inside a folder synced by Microsoft OneDrive on Windows, the build may halt with:
Error: EPERM: operation not permitted, rmdir '...\frontend\.next\build\chunks'

Why This Happens

Microsoft OneDrive continuously monitors directory changes in synchronized folders. When Next.js compiles chunks, OneDrive locks subdirectories (such as .next/build/chunks) to calculate file hashes and sync status, setting Windows file attributes (ReparsePoint and ReadOnly). Node.js fs.rmdirSync cannot unlink active OneDrive reparse points while the sync client holds an open lock.

Safe Remediation (Do NOT Unsafely Delete User Files)

  1. Pause OneDrive Sync During Builds: Right-click the OneDrive cloud icon in the Windows taskbar and select “Pause syncing → 2 hours” before running production builds.
  2. Exclude .next from Cloud Sync: Ensure .next is included in your project root .gitignore. In Windows PowerShell, clear readonly flags if locked:
    PowerShell
    # Check file attributes in PowerShell without deleting files:
    Get-Item -Path "frontend\.next\build\chunks" | Format-List Attributes
    
    # Safe workaround: Point Next.js build cache to a local directory outside OneDrive sync:
    # In next.config.ts:
    # distDir: process.env.NEXT_DIST_DIR || '.next'
  3. Build Outside Synced Directory: In CI/CD or production environments, clone repositories into local directories outside cloud storage sync roots (e.g. C:\dev\sictack or Linux containers).

Authentication & API Key Issues

HTTP 401 Unauthorized: Invalid API Key

Check: API keys must be passed in the header X-API-Key: ilk_live_... (or Authorization: Bearer <key>).

Confirm your key starts with ilk_live_ or ilk_test_. If revoked, generate a replacement in the SOC dashboard.

HTTP 401 Unauthorized: Token has expired

Check: Operator JWT tokens have a 24-hour expiration window (ACCESS_TOKEN_EXPIRE_MINUTES=1440). Re-authenticate via POST /api/v1/auth/login to obtain a fresh token.

Permission Denials & Policy Debugging

When a tool call returns DENY, inspect the reason string in the Decision object:

Reason CodeTrigger ConditionHow to Resolve
TOOL_NOT_REGISTEREDThe agent attempted to invoke a tool name not present in the registry.Register the callable via agent.register_tool() or check tool name spelling.
PERMISSION_DENIEDThe tool's required permission is present in denied_permissions or missing from allowed_permissions.Update the policy in the dashboard or pass an updated Policy definition.
SENSITIVITY_TOO_HIGHTool sensitivity exceeds policy max_sensitivity.Lower tool sensitivity or increase policy ceiling for authorized agents.
RECIPIENT_NOT_ALLOWEDTarget recipient email domain does not match allowed_recipients pattern.Add the authorized domain pattern (e.g. *@partner.com) to the policy.
POLICY_MISSING_FAIL_CLOSEDNo active policy found for tenant or registered agent.Create an organization default policy via POST /api/v1/policies.

Approval Expiration & Replay Errors

ApprovalExpiredError (410)

The approval ticket exceeded its TTL (default 300s). The agent must re-request the operation to generate a new pending ticket.

ApprovalMismatchError (400)

The payload arguments executed by the agent differ from what the human operator approved. Check for modified variables or dynamic timestamps.

ApprovalReplayError (409)

The approval ticket has already been consumed. Approvals are strictly single-use nonces; subsequent calls require new tickets.

Backend Connectivity & Database Errors

Render Free-Tier Cold Starts (HTTP 504 / Connection Timeout)

Symptom: The first request to the backend after 15 minutes of inactivity takes 30–50 seconds to respond.

Explanation: Free Render web services spin down on idle. In your client, configure a higher initial timeout (timeout=60.0) or upgrade to an always-on instance for production workloads.

FATAL: remaining connection slots are reserved for non-replication superuser connections

Symptom: PostgreSQL connection pool exhaustion on Supabase.

Fix: Switch your connection string from direct port 5432 to the Supabase Transaction Pooler port 6543. Ensure your URL includes ?sslmode=require.

Missing Organization Context

In multi-tenant operations, requests without a resolved organization context fall back to the default organization. When explicitly required by strict endpoints:

  • Pass header: X-Organization-ID: your-org-slug.
  • Or ensure your operator JWT token was minted with the org_id claim.

Framework Adapter Issues (LangChain, LangGraph, MCP)

LangChain: Tool Error Propagation

By default, SecureTool sets handle_tool_error=True. Instead of crashing your agent, security denials are caught and formatted as text for the LLM. If your application code needs typed exceptions, set it to False:

LangChain Error Handling
# LangChain Adapter: Distinguishing Tool Error Handling
from sictack.integrations.langchain import SecureTool

# Default behavior: handle_tool_error=True
# Returns string to LLM: "[SECURITY_ERROR: PermissionDeniedError] Action 'db_drop' denied"
safe_tool = SecureTool(tool=my_tool, agent=agent, handle_tool_error=True)

# Strict exception mode: handle_tool_error=False
# Raises PermissionDeniedError or ApprovalRequiredError directly to calling code
strict_tool = SecureTool(tool=my_tool, agent=agent, handle_tool_error=False)

LangGraph: Missing Approval Exception

In LangGraph, SecureGraphNode does not raise ApprovalRequiredError. Instead, it captures the requirement and branches state by returning {"_sictack_status": "REQUIRE_APPROVAL", "_approval_id": "..."} (alongside legacy _intentlock_status). Verify that your graph includes a conditional edge routing this state to an approval node.

Model Context Protocol: JSON-RPC Code -32603

When MCPSecurityProxy intercepts a disallowed tool call, it responds with a standard JSON-RPC 2.0 error object. Inspect the error.data._sictack dictionary (or legacy _intentlock) in client responses to view full verdict reasons.

Quick Diagnostics Matrix

Error Code / ExceptionPrimary CauseImmediate Diagnostic Action
401 UnauthorizedInvalid or missing API key / JWTCheck X-API-Key or re-login for new JWT.
403 ForbiddenRole insufficient or unapproved tokenCheck user role (ADMIN vs VIEWER).
409 ConflictApproval token already consumed (replay)Request a new approval ticket for subsequent execution.
410 GoneApproval token expired (TTL exceeded)Increase timeout or approve before expiration window.
EPERM -4048OneDrive lock on .next/build/chunksPause OneDrive sync or build in unsynced directory.