SAST Security Scanner for LLM Agents: Detect Prompt Injections & Data Leaks in AI Workflows
scankii provides 14 tools with mostly complete schemas and descriptions. Naming is clear and action-oriented (scan_*, analyze_*, classify_*, score_*). Descriptions are present and substantive (avg ~150 chars), explaining WHAT each tool does. However, parameter descriptions are sparse or missing for several tools (e.g., tool_guard's 'func' param lacks detail; ToolGuard context manager has minimal guidance). Output schemas are not documented, callers cannot see what fields to expect from findings or scored results. Error handling is absent: no guidance on what happens when analysis fails, no recovery hints. Security tools (tool_guard, ToolGuard) lack explicit permission/scope declarations. Composition is reasonable, tools chain logically (scan → analyze → score), but no pagination or result-limiting patterns for large codebases.
Context manager that applies a guard policy to all decorated tool calls. The policy set by the context manager overrides the per-decorator policy for any @tool_guard-decorated function called within the with block.
Analyze a source file for credential-to-sink flows using AST analysis. Detects when credential variables are passed to network, logging, or file sinks.
Analyze source code from a string for credential-to-sink flows. Useful for testing and dynamic analysis.
Detect cross-modal leakage where NL instructions reference credentials AND matching AST findings exist for the same credential term. Escalates severity when both modalities confirm the issue.
Analyze markdown text and return natural-language security findings. Detects credential actions, prompt injections, and social engineering patterns in documentation.
Classify a candidate secret string as real or placeholder using Shannon entropy and allowlist matching. Combines entropy and allowlist into a single confidence score (0.0 = definitely placeholder, 1.0 = definitely real secret).
Output schemas not documented. Tools like score_finding, score_findings, and all analyze_* tools return complex objects (ScoredFinding, NLFinding, ASTFinding, etc.) but callers cannot see field names, types, or structure. LLMs cannot plan downstream operations or extract required data.
Parameter descriptions incomplete or missing. tool_guard's 'func' parameter lacks description (callable type is clear but usage context is not). ToolGuard context manager has no parameter guidance. Several optional parameters (credentials_path, sinks_path, rules_path) lack detail on format, location, or defaults.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 52 | 2026-07-28+ | v2 |
Return True if a value matches any known dummy/placeholder pattern from the allowlist.
Scan raw text content for malicious patterns. Reads content as text and matches against patterns from malicious.yaml.
Scan a skill directory for security findings. Analyzes source code for credential leakage, prompt injections, and data leaks.
Scan a file for malicious patterns like reverse shells, remote fetch-execute, base64 obfuscation, and credential theft.
Score a finding on five axes (exploitability, credential type, leakage channel, pattern category, entropy) and return a ScoredFinding with numeric score, final severity, and confidence.
Score a list of findings and return a list of ScoredFinding objects.
Compute the Shannon entropy of a string in bits per character. Real high-entropy secrets: ~3.5–5.5 bits/char. LLM placeholder strings: ~1.5–3.0 bits/char.
Decorator that guards a tool function against credential leakage. Can be used with or without arguments. Supports policies: 'block' (raise ToolCallBlocked), 'redact' (redact credentials in-place), or 'warn' (log warning and allow).
No error handling or recovery guidance. Tools provide no documentation of failure modes, error codes, or what to do if analysis fails. E.g., what happens if a file is unreadable, syntax is invalid, or rules files are missing? No actionable error messages.
No permission or scope declarations. Security-critical tools (tool_guard, ToolGuard, scan_directory) do not declare what permissions they require or what they can access. Agents cannot be configured with least-privilege scopes.
No pagination or result-limiting patterns. scan_directory and analyze_* tools may return large finding lists for big codebases, but no limit, offset, or cursor parameters are documented. Large result sets blow context windows.