Rules
OpenSploit allows customization through an AGENTS.md file containing custom instructions that guide the AI's behavior for your specific engagement context.
Overview
Rules help you:
- Define engagement scope and boundaries
- Set methodology preferences
- Specify tool configurations
- Establish reporting requirements
- Share context across sessions
Setup
Generate a project-specific AGENTS.md file using the /init command:
/init
OpenSploit analyzes your workspace and creates an initial configuration. Commit this file to version control for team consistency.
File Locations
Project-Level
Place AGENTS.md in the project root. Rules apply only within that directory and subdirectories.
/pentest-engagement/
├── AGENTS.md # Rules for this engagement
├── scope.txt
└── findings/
Global-Level
Place rules at ~/.config/opensploit/AGENTS.md to apply them across all sessions. Useful for personal preferences and default configurations.
Precedence
OpenSploit searches for rules in this order:
- Local files by traversing up from the current directory
- Global file at
~/.config/opensploit/AGENTS.md
When both exist, they combine together.
Example AGENTS.md
# Engagement Rules
## Scope
- Target: 10.10.10.0/24
- Authorized systems only
- No denial of service testing
- Web applications on ports 80, 443, 8080
## Methodology
- Follow OWASP Testing Guide
- Prioritize critical findings
- Document all exploitation attempts
## Tools
- Prefer nmap for port scanning
- Use nuclei for vulnerability scanning
- SQLMap for SQL injection testing
## Reporting
- Generate findings in markdown format
- Include severity ratings (Critical, High, Medium, Low)
- Capture screenshots where possible
Advanced Configuration
Specify additional rule files in opensploit.json:
{
"instructions": [
"SCOPE.md",
"docs/methodology.md"
]
}
This supports glob patterns for complex projects:
{
"instructions": [
"engagements/*/rules.md"
]
}
External File References
Reference external files in your rules using the @ syntax:
# Engagement Rules
Refer to the authorized scope:
@scope.txt
Follow the client's security policy:
@docs/security-policy.pdf
OpenSploit loads referenced files on-demand when relevant to the current task.
Best Practices
- Keep rules focused - Specific rules work better than vague guidelines
- Update regularly - Modify rules as the engagement progresses
- Version control - Track changes to rules over time
- Team alignment - Ensure all team members use the same rules
- Scope clarity - Explicitly define what's in and out of scope