“You cannot secure what you cannot see.”
This guide will help you audit your current AI codebase for the three most common vulnerabilities: Hardcoded Secrets, Prompt Injection Risks, and Unrestricted Dependencies.
This quick audit exercises configured scan and gateway paths; it does not assign organizational AISM maturity. To assess a candidate product or technique, use the Technology Contribution Profile and Technology Card, recording actual control effects, evidence, tested boundary, and gaps.
Goal: Detect common credential and configuration exposure patterns quickly.
Use the repository’s unified safe2 CLI to scan against the AI SAFE² controls.
git clone https://github.com/CyberStrategyInstitute/ai-safe2-framework.git
cd ai-safe2-framework
pip install -e ".[all]"
Navigate to your project folder and run the scan:
safe2 scan project ./my-project
# To make the result a blocking CI decision:
safe2 gate project ./my-project --fail-under 80
Goal: Sanitize inputs without rewriting your whole app. Instead of writing 50 lines of regex validation, use the AI SAFE² Gateway pattern.
docker build -t ai-safe-gateway .
docker run -p 8000:8000 ai-safe-gateway
client = OpenAI(api_key=”sk-…”)
client = OpenAI( base_url=”http://localhost:8000/v1”, api_key=os.getenv(“OPENAI_API_KEY”) ) ```
| Risk | Status |
|---|---|
| Secret Leaks | 🔎 ASSESSED (review findings and rotate exposed credentials) |
| Prompt Injection | 🧪 PATH EXERCISED (verify the policy decision and retained evidence) |
| Compliance | 📝 EVIDENCE STARTED (logging alone does not establish conformance) |