Overview
Penetration testing is a powerful tool for improving security, but it must be conducted responsibly and ethically. This guide outlines best practices for using PentAGI in a professional, legal, and ethical manner.Legal and Ethical Framework
Authorization Requirements
Define scope boundaries
Clearly document what is in and out of scope:In-scope examples:
- Specific IP ranges: 10.10.10.0/24
- Named domains: target.example.com
- Specific applications or services
- Defined testing methods
- Production databases during business hours
- Third-party services not owned by client
- Social engineering against employees
- Denial of service attacks
Establish rules of engagement
Define testing constraints:
- Testing windows: When testing can occur
- Notification requirements: Who to contact if issues arise
- Escalation procedures: What to do if critical issues found
- Data handling: How to handle sensitive data discovered
- Stop work triggers: Conditions requiring immediate halt
Professional Conduct
Do's
Do's
- Communicate clearly: Keep client informed of progress and findings
- Respect privacy: Minimize access to personal or sensitive data
- Be transparent: Disclose all actions taken during testing
- Maintain confidentiality: Protect client information
- Follow scope: Stay within authorized boundaries
- Report responsibly: Disclose vulnerabilities only to authorized parties
- Minimize impact: Avoid disrupting business operations
- Clean up: Remove test artifacts after engagement
Don'ts
Don'ts
- Never exceed authorization: Even if technically possible
- Don’t retain client data: Unless explicitly authorized
- Avoid production impact: Don’t cause outages or data loss
- Don’t disclose publicly: Keep findings confidential
- Don’t test without consent: No matter how “vulnerable” the target
- Avoid collateral damage: Don’t impact third-party systems
- Don’t install backdoors: Unless explicitly part of red team engagement
- Never steal data: Access only what’s necessary to demonstrate vulnerability
PentAGI-Specific Security Practices
Installation Security
Enable TLS/SSL
Use proper TLS certificates in production:
.env
Self-signed certificates are acceptable for internal testing but should be replaced with proper CA-signed certificates for production.
Network isolation
Isolate PentAGI from production networks:
- Deploy in dedicated testing VLAN
- Use firewall rules to restrict access
- Implement network segmentation
- Consider air-gapped environments for sensitive tests
Data Protection
Sensitive data handling
Sensitive data handling
PentAGI may encounter sensitive data during testing:Prevention:Database credentials:
- Mask passwords in reports
- Store securely if needed for testing
- Delete after engagement completes
Memory and storage security
Memory and storage security
PentAGI stores testing data in multiple systems:Vector Store (PostgreSQL):
- Contains command history and outputs
- Encrypted at rest (enable database encryption)
- Regular backups with secure storage
- Purge old engagements periodically
- Stores entity relationships
- May contain target infrastructure details
- Secure with authentication
- Clear after engagement if required
- Some providers log API requests
- Be aware of data retention policies
- Consider local models (Ollama) for sensitive engagements
- Review provider privacy policies
Report security
Report security
Protect penetration testing reports:
- Encrypt reports at rest and in transit
- Use secure channels for distribution (not email)
- Limit report recipients to authorized personnel
- Include classification markings (Confidential, etc.)
- Set expiration dates for report access
- Securely delete reports when no longer needed
Distributed Setup Security
When using worker nodes:Worker node isolation
- Deploy workers in isolated network segments
- Use TLS for all Docker API communications
- Implement strong certificate validation
- Regularly update worker node systems
Operational Security
Stealth and Detection Avoidance
When stealth matters
When stealth matters
For authorized red team engagements simulating real attacks:
When NOT to use stealth
When NOT to use stealth
For standard vulnerability assessments:
- Be noisy: Use aggressive scans for complete coverage
- Announce testing: Coordinate with SOC/security team
- Trigger alerts: Test detection capabilities
- Document everything: Maintain clear audit trail
- Communicate: Keep stakeholders informed
Incident Response
If you cause an outage
- Stop testing immediately
- Notify emergency contact (from authorization documentation)
- Document what happened (command, timing, result)
- Assist in recovery if requested
- Update testing procedures to prevent recurrence
If you discover active attack
- Document evidence without interfering
- Notify client immediately (may be security incident)
- Preserve logs and artifacts
- Follow client incident response procedures
- Do not engage the attacker
LLM Provider Considerations
Privacy and Data Residency
- Cloud Providers
- Local Models (Ollama)
- Custom Providers
When using OpenAI, Anthropic, Google, or AWS Bedrock:Data handling:
- Requests are sent to provider APIs
- Some providers log interactions
- Data may cross borders
- Review provider privacy policies
- Avoid sending sensitive data in prompts
- Mask credentials and PII
- Use provider enterprise agreements for enhanced privacy
- Consider data residency requirements
- Review terms of service
Prompt Injection Awareness
Protecting against prompt injection
Protecting against prompt injection
If testing output becomes input to PentAGI:
Validating AI findings
Validating AI findings
Always verify AI conclusions:
- Cross-reference with actual tool output
- Manually verify critical findings
- Don’t rely solely on AI interpretation
- Test proof-of-concept exploits
- Validate remediation guidance
Reporting Best Practices
Executive Summary
Components
Components
- Engagement overview: Scope, dates, methodology
- Key findings: Critical and high severity issues
- Risk assessment: Overall security posture
- Recommendations: Prioritized remediation steps
- Metrics: Vulnerabilities by severity, CVSS scores
Technical Details
For each finding:Vulnerability description
- Clear, non-technical explanation
- Technical details for security team
- Affected systems and components
- CVSS score and severity rating
Reproduction steps
- Exact steps to reproduce
- Required tools and commands
- Screenshots or evidence
- Expected vs actual behavior
Impact assessment
- What attacker could achieve
- Affected data or systems
- Business impact
- Compliance implications
Responsible Disclosure
For vendor vulnerabilities
For vendor vulnerabilities
If you discover vulnerabilities in third-party software:
- Report to vendor first (not publicly)
- Allow reasonable time for fix (typically 90 days)
- Coordinate disclosure with vendor
- Credit researchers appropriately
- Follow disclosure policy if vendor has one
- Protect end users during disclosure process
Continuous Improvement
Post-Engagement Review
Lessons learned
- What worked well
- What could be improved
- Unexpected findings
- Tool effectiveness
- Time allocation
Knowledge base update
If using Graphiti knowledge graph:
- Document new attack patterns
- Record successful techniques
- Note tool combinations that worked
- Update threat intelligence
Staying Current
Training and certifications
Training and certifications
- Maintain professional certifications (OSCP, GPEN, etc.)
- Attend security conferences
- Participate in CTF competitions
- Follow security research
- Practice on legal targets (HackTheBox, TryHackMe)
Tool updates
Tool updates
- Regularly update PentAGI
- Update security tools in containers
- Test new LLM models
- Review security advisories
- Subscribe to vendor updates
Threat intelligence
Threat intelligence
- Monitor vulnerability disclosures
- Track exploit developments
- Follow threat actor TTPs
- Review incident reports
- Share knowledge with community
Compliance and Standards
Industry Standards
- OWASP
- NIST
- PCI DSS
- ISO 27001
Follow OWASP Testing Guide:
- Web Application Security Testing
- API Security Testing
- Mobile Application Testing
- Use OWASP Top 10 as baseline
Emergency Contacts
Maintain emergency contact information for:
- Client technical lead
- Client security team
- Client incident response
- Your management/escalation
- Legal counsel (if needed)
- Relevant authorities (in case of criminal activity discovered)
Summary Checklist
Before, during, and after every engagement:Additional Resources
First Pentest
Apply best practices to your first test
Advanced Techniques
Responsible use of advanced methods
Custom Assistants
Configure assistants for responsible testing
Distributed Setup
Secure distributed deployments