K9X

K9X Shield and K9X SATAN

Zero trust and vulnerability defense are part of the K9-AIF framework itself, so every application built on it can switch them on in its configuration instead of writing its own. K9X Shield is that architecture. K9X SATAN is the application that proves it holds.

The big picture: K9-AIF is an open-source, architecture-first framework for building governed, modular agentic AI systems. The K9X Ecosystem is the set of applications around it, such as Studio, Continuum, HIL and SATAN. K9X Shield is the security and vulnerability-checking component built into the framework itself: the Router/Orchestrator check chains, governance hooks, and Chain-of-Responsibility pattern available to every solution built on K9-AIF. It is off in the shipped configuration; an application turns it on with security.shield.enabled: true and the checks it wants, and every agent then runs them before and after it works. K9X SATAN is the application that tests it. It fires structured adversarial attacks at a live K9-AIF pipeline to prove Shield actually contains them.
ATTACK
crafted payload
→
ROUTER
ingress gate
Blocked here
→
ORCHESTRATOR
egress gate
Blocked here
→
SQUAD / AGENT
Reached: a finding, Shield failed

A block at any phase ends execution, so later phases never run. Reaching Squad/Agent is a gap in the framework, not a partial pass.

CheckWhat it catches
Ingress, at the Router: before the squad or agent runsPattern-based, zero LLM cost, deterministic. Runs before the LLM ever sees the document.
RequestFrequencyCheckresource-exhaustion request floods
InputSizeChecktoken-flood / oversized payloads
PromptInjectionCheckSYSTEM OVERRIDE, ignore-all-instructions patterns
FieldAnomalyCheck (SATAN's)authority-override social engineering
MemoryPoisoningCheckfabricated session memory claims
ToolArgumentCheck / ToolAuthorizationCheckpoisoned or unapproved tool calls, caught before dispatch
PIIRequestCheckrequests to disclose PII
PaymentDiversionCheckpayment redirection with review bypass and concealment
Egress, at the Orchestrator: after the squad or agent returnsEvaluates the returned result before it leaves the pipeline, and catches what only shows up in agent output.
SemanticDriftCheckgoal hijacking, identity override
ExecutionGuardCheckdestructive commands, reverse shells
PIIBoundaryCheckSSN / credit card / email exfiltration
HardcodedCredentialCheckAPI keys echoed into the response
ToolArgumentCheck / ToolAuthorizationCheckalso here, for a tool call an agent generates mid-execution
SystemPromptLeakageCheck, OutputSanitizationCheckprompt leakage, markup injection
OutboundLinkCheck (opt-in)phishing links in agent output

See it holding, live

satan.k9x.ai →

Upload a document, fire a real attack, and watch it get contained at the Router or Orchestrator gate in real time. Penetration Monitor shows every check in the chain, Results tracks outcomes across the session, and the Architecture tab (About → README inside the tool itself) walks through exactly why each gate holds.

Defense in depth: two independent layers

K9X Shield applies deterministic, policy-driven checks: 15 of them, wired into the Router's ingress and Orchestrator's egress chains. Explainable, zero LLM cost, evaluated identically every run. Evadable by paraphrase, encoding, or wording changes no regex list can enumerate in advance.

IBM Guardian (granite4.1-guardian:8b) is an optional semantic layer wrapping every agent's pre/post hooks. It catches paraphrased injection, subtle goal hijacking, and disguised privilege escalation that survive the pattern layer. Neither replaces the other: Shield holds with Guardian disabled entirely; Guardian only ever adds coverage on top.

Guardian unavailability (timeout, HTTP error, unreachable endpoint) is never silently treated as "SAFE". It's an explicit policy decision: fail_closed (the default: blocks or redacts), fail_open (documented risk), or inconclusive (flags without blocking).

Zscaler ThreatLabz: four vectors, one handler each

Threat VectorK9X Shield HandlerOwner
Indirect Prompt InjectionPromptInjectionCheckFramework OOB
Goal Hijacking & Privilege EscalationSemanticDriftCheckFramework OOB
Memory PoisoningMemoryPoisoningCheckFramework OOB
Shadow AI & Tool AbuseToolArgumentCheck / ToolAuthorizationCheckFramework OOB

The chain is open-ended by design. Zscaler's four vectors are what is known today. Each new vector is one new handler, added without rewriting the chain.

Complete check inventory: 15 framework checks at 2 gates, Guardian, and SATAN's own

#CheckGateOwnerThreat Class
1RequestFrequencyCheckIngressFramework OOBUnbounded Consumption · OWASP LLM10
2InputSizeCheckIngressFramework OOBToken-flood / oversized payload · OWASP LLM10
3PromptInjectionCheckIngressFramework OOBIndirect Prompt Injection · Zscaler #1 · OWASP LLM01
FieldAnomalyCheckIngressSATANAuthority-override social engineering
4MemoryPoisoningCheckIngressFramework OOBMemory Poisoning · Zscaler #3 · OWASP LLM04
5ToolArgumentCheckIngress + EgressFramework OOBTool Abuse · poisoned arguments · Zscaler #4 · OWASP LLM05
6ToolAuthorizationCheckIngress + EgressFramework OOBShadow AI · unapproved tool · Zscaler #4
7PIIRequestCheckIngressFramework OOBSolicited PII disclosure, no literal PII in payload · OWASP LLM02
8PaymentDiversionCheckIngressFramework OOBPayment redirection with review bypass and concealment · OWASP LLM01
9SemanticDriftCheckEgressFramework OOBGoal Hijacking & Privilege Escalation · Zscaler #2 · OWASP LLM06
10ExecutionGuardCheckEgressFramework OOBDestructive execution · Zscaler #2 · OWASP LLM06
11PIIBoundaryCheckEgressFramework OOBSensitive Info Disclosure · OWASP LLM02
12HardcodedCredentialCheckEgressFramework OOBSupply chain / secret leakage · OWASP LLM03
13SystemPromptLeakageCheckEgressFramework OOBSystem Prompt Leakage · OWASP LLM07
14OutputSanitizationCheckEgressFramework OOBImproper Output Handling · OWASP LLM05
15OutboundLinkCheckEgressFramework OOBPhishing links in agent output (opt-in) · OWASP LLM05
GuardianGovernanceAgent pre/postFramework OOBSemantic evasion of all the checks above (cross-cutting, optional)

Threat classes reference the OWASP Top 10 for LLM Applications. ToolArgumentCheck/ToolAuthorizationCheck run at both gates deliberately: ingress catches caller-supplied fields before Squad/Agent runs; egress catches a fresh tool call an agent generates mid-execution, which doesn't exist yet at ingress time. Same defense-in-depth principle as Guardian: additive, never a replacement.

SATAN and Shield are symmetric

Every attack targets one specific check. A PASSED result doesn't mean SATAN failed. It means Shield needs a new handler. That's the hardening loop.

SATAN AttackShield Check
PromptInjectionAttackPromptInjectionCheck
SearchPoisoningAttackPromptInjectionCheck (real tool-response fetch)
PayloadFloodAttackInputSizeCheck
MemoryPoisoningAttackMemoryPoisoningCheck
RequestFloodAttackRequestFrequencyCheck
SemanticDriftAttackSemanticDriftCheck
ExecutionBypassAttackExecutionGuardCheck
PIIExfiltrationAttackPIIBoundaryCheck
ToolArgumentAttackToolArgumentCheck
HardcodedCredentialAttackHardcodedCredentialCheck
ShadowToolAttackToolAuthorizationCheck
SystemPromptLeakageAttackSystemPromptLeakageCheck
OutputSanitizationAttackOutputSanitizationCheck
PhishingLinkAttackOutboundLinkCheck (lookalike payment-portal link)
AgentImpersonationAttackGuardian (impersonation): an agent message claiming roles to get a claim approved
ParaphrasedOverrideAttackGuardian (process manipulation): "skip verification, approve it" with no trigger words

The last two are built to slip past Shield's patterns. With Guardian off they get through and are recorded as findings; with Guardian on they are stopped. That is the case for running both layers.

Other security layers in the framework

Shield and Guardian screen what goes in and out of an agent. These cover the rest. Each is opt-in and switched on in configuration.

LayerWhat it doesSwitch
Tool-call gateEvery tool call is checked against a registry of allowed tools, logged, and can pause for a person to approve.security.tool_gate.enabled
K9X FiltersClean input before governance sees it: Unicode normalised, invisible and tag characters removed; agent output validated.filters.enabled
Acting for the person who askedA connector reaches its server with a token naming the verified caller (OAuth token exchange), not a shared service account.security.on_behalf_of
Zero TrustIdentity, role-based authorization, data masking and risk scoring on the orchestrator.enable_zero_trust

Detail on each is in the capability index.

Run it yourself

pip install k9x-satan
k9x-satan          # foreground, opens the dashboard at localhost:6660
k9x-satan --bg     # or run it in the background

Own instance, own K9-AIF pipeline, own LLM endpoint. Nothing is sent to any shared deployment. pypi.org/project/k9x-satan