Decisions & Approvals
Understand how SICTACK classifies agent actions, assigns deterministic risk scores, and manages the cryptographic human-in-the-loop approval lifecycle.
The Decision Model
Every authorization evaluation in SICTACK (whether in-process or via the remote gateway) produces a standardized Decision model:
from pydantic import BaseModel
from typing import Any, Dict
from sictack.models import DecisionVerdict, RiskLevel
class Decision(BaseModel):
verdict: DecisionVerdict # ALLOW, DENY, REQUIRE_APPROVAL
action_hash: str # SHA-256 canonical hex digest
risk_score: float # Deterministic risk metric (0.0 to 1.0)
risk_level: RiskLevel # LOW, MEDIUM, HIGH, CRITICAL
metadata: Dict[str, Any] # Includes approval_id, policy_rule, etc.DecisionVerdict Values
The verdict field is an enum representing the explicit authorization outcome:
| Verdict | Description | Action Expected by Developer |
|---|---|---|
| ALLOW | The tool call passed all permission, policy, and context checks. | Execute the tool callable immediately. |
| REQUIRE_APPROVAL | Action touches sensitive resources; requires human operator confirmation. | Suspend execution; poll or listen for approval completion before proceeding. |
| DENY | Action violates policy, lacks permission, or exceeds context boundaries. | Abort tool call; raise error or feed denial message back to agent prompt. |
RiskLevel & Risk Scoring
SICTACK computes a deterministic risk metric between 0.0 and 1.0, categorized into four discrete tiers:
Canonical Action Hashes
The action_hash is a 64-character hexadecimal SHA-256 digest computed over the canonical representation of the action. It serves as an immutable fingerprint that binds approvals directly to the exact arguments inspected by the security engine.
Evaluating Decisions in Application Code
When using the remote client, pattern match against the verdict to determine safe downstream actions:
from sictack import SictackClient
from sictack.models import DecisionVerdict, RiskLevel
client = SictackClient(api_key="...", base_url="https://...", agent_id="agent-1")
decision = client.intercept(
tool_name="publish_social_post",
arguments={"channel": "twitter", "content": "Welcome to our launch event!"}
)
match decision.verdict:
case DecisionVerdict.ALLOW:
# Action is authorized: invoke your local tool
execute_local_tool()
case DecisionVerdict.REQUIRE_APPROVAL:
# Extract approval request identifier
approval_id = decision.metadata.get("approval_id")
print(f"Action suspended. Awaiting human sign-off: ticket {approval_id}")
case DecisionVerdict.DENY:
# Action blocked: record or notify
print(f"Action rejected by policy. Risk score: {decision.risk_score}")