Shannon’s agent behavior is controlled through prompt templates stored in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/KeygraphHQ/shannon/llms.txt
Use this file to discover all available pages before exploring further.
prompts/ directory. This guide explains how to customize these prompts.
Prompt System Overview
Prompts are plain text files with:- Variable substitution - Dynamic content injection
- Include directives - Shared section reuse
- MCP server assignment - Automatic Playwright instance allocation
src/services/prompt-manager.ts before being sent to the AI model.
Prompt Structure
A typical prompt template has this structure:prompts/vuln-example.txt
Variable Substitution
Variables are automatically replaced when the prompt is loaded. Available variables:Core Variables
{{WEB_URL}}- Target application URL{{REPO_PATH}}- Source code repository path{{MCP_SERVER}}- Assigned Playwright instance (e.g.,playwright-agent1)
Configuration Variables
{{LOGIN_INSTRUCTIONS}}- Authentication flow from config file{{RULES_AVOID}}- Testing restrictions from config{{RULES_FOCUS}}- Testing priorities from config
Example Usage
config.yaml
Include Directives
Reuse shared sections with@include() directives:
prompts/shared/.
Available Shared Partials
_target.txt- Target application and repository information_rules.txt- Testing rules (avoid/focus areas)_vuln-scope.txt- Vulnerability analysis scope and guidelines_exploit-scope.txt- Exploitation scope and guidelineslogin-instructions.txt- Authentication flow template
Creating Custom Partials
Create new shared sections:Login Instructions Template
The{{LOGIN_INSTRUCTIONS}} variable is built from prompts/shared/login-instructions.txt based on the authentication type in your config.
Template Sections
The template uses section markers:prompts/shared/login-instructions.txt
authentication.login_type in config.
Credential Substitution
Within login instructions, credentials are substituted:$username→ Actual username from config$password→ Actual password from config$totp→ TOTP code generation instructions{{totp_secret}}→ Actual TOTP secret from config
Example
Config file:MCP Server Assignment
Playwright instances are automatically assigned based on theMCP_AGENT_MAPPING in src/session-manager.ts:
src/session-manager.ts
{{MCP_SERVER}} variable is automatically set to the correct instance.
Agents that run in parallel must use different Playwright instances to avoid conflicts. Agents in the same vulnerability/exploit pair should use the same instance.
Customizing Existing Prompts
Modifying Analysis Depth
Increase or decrease analysis thoroughness:prompts/vuln-injection.txt
Adjusting Exploitation Aggressiveness
prompts/exploit-injection.txt
Testing Custom Prompts
Pipeline Testing Mode
UsePIPELINE_TESTING=true to test with minimal prompts:
prompts/pipeline-testing/ instead of prompts/. Create simplified versions there for rapid iteration.
Prompt Snapshots
Shannon saves the final interpolated prompt toaudit-logs/{sessionId}/prompts/ for every agent execution. Review these to verify variable substitution and includes worked correctly.
Example Workflow
Review the snapshot
Check
audit-logs/{sessionId}/prompts/vuln-injection.txt to see the final prompt sent to the AI.Review agent output
Check
audit-logs/{sessionId}/agents/injection-vuln.log for agent execution logs.Best Practices
Be Specific
Provide clear, measurable success criteria. Vague objectives lead to inconsistent results.
Use Examples
Include examples of good and bad patterns in the prompt to guide the AI.
Structure Output
Explicitly specify deliverable formats (Markdown, JSON, etc.) and required sections.
Leverage Includes
Reuse shared sections instead of duplicating content across prompts.
Advanced: Conditional Logic
Prompts don’t support native conditionals, but you can use variable substitution for dynamic content:Troubleshooting
Unresolved Placeholders
If you see warnings like:- Variable name matches exactly (case-sensitive)
- Variable is defined in
src/services/prompt-manager.ts - Config file provides the necessary data
Include File Not Found
- File exists in
prompts/shared/ - Path is relative to
prompts/directory - No typos in the include path
Prompt Too Long
If the final prompt exceeds model context limits:- Move verbose examples to external files
- Use more concise methodology descriptions
- Reference documentation URLs instead of embedding content