Get up and running with Intent Security Agent in 5 minutes.
# Install skill
npx skills add nispatil/self-improving-intent-security-agent
# Clone repository
git clone https://github.com/nispatil/self-improving-intent-security-agent.git
cd self-improving-intent-security-agent
# Run setup script
./scripts/setup.sh
# Create agent directories
mkdir -p .agent/{intents,violations,learnings,audit}
# Required
export AGENT_INTENT_PATH=".agent/intents"
export AGENT_AUDIT_PATH=".agent/audit"
# Optional (with defaults shown)
export AGENT_RISK_THRESHOLD="medium" # low | medium | high
export AGENT_REQUIRE_APPROVAL_HIGH_RISK="true"
export AGENT_AUTO_ROLLBACK="true"
export AGENT_LEARNING_ENABLED="true"
export AGENT_ANOMALY_THRESHOLD="0.8"
# Create intent specification
cat > .agent/intents/INT-$(date +%Y%m%d)-001.md <<'EOF'
## [INT-$(date +%Y%m%d)-001] my_first_task
**Created**: $(date -Iseconds)
**Risk Level**: low
**Status**: active
### Goal
Process customer feedback files and extract sentiment
### Constraints
- Only read files in ./feedback directory
- Do not modify original files
- Respect PII privacy rules
### Expected Behavior
- Read files sequentially
- Apply analysis
- Generate summary report
### Context
- Relevant files: ./feedback/*.txt
- Environment: development
EOF
If you want a transcript, report, and .agent artifacts together:
./scripts/scaffold-run.sh examples/my-demo customer_feedback medium
This creates:
conversation.mdreport.md.agent/intents/....agent/audit/....agent/violations/....agent/learnings/...# Create feedback directory
mkdir -p feedback
# Add sample feedback file
cat > feedback/customer_001.txt <<'EOF'
Great product! Very satisfied with the service.
EOF
cat > feedback/customer_002.txt <<'EOF'
Had some issues initially, but support team was helpful.
EOF
Action: Read ./feedback/customer_001.txt
Validation:
Goal Alignment: ✓ (reading for processing)
Constraints: ✓ (read-only, correct directory)
Behavior: ✓ (sequential reading as expected)
Authorization: ✓ (read permission)
Result: ALLOWED → Execute
Action: Delete ./feedback/customer_001.txt
Validation:
Goal Alignment: ✗ (deletion not part of processing)
Constraints: ✗ (violates "do not modify")
Behavior: ✗ (deletion not expected)
Result: BLOCKED → Logged to VIO-xxx.md
# View violations
cat .agent/violations/VIOLATIONS.md
# Find high-severity violations
grep -l "Severity**: high" .agent/violations/*.md
# View learnings
cat .agent/learnings/LEARNINGS.md
# View evolved strategies
cat .agent/learnings/STRATEGIES.md
# Run report script
./scripts/report.sh
# Output shows:
# - Active intents
# - Recent violations
# - Learning progress
# - Success metrics
Create .agent/config.json for advanced configuration:
{
"security": {
"requireApproval": ["file_delete", "api_write", "command_execution"],
"autoRollback": true,
"anomalyThreshold": 0.8,
"maxPermissionScope": "read-write"
},
"learning": {
"enabled": true,
"minSampleSize": 10,
"abTestRatio": 0.1,
"maxStrategyComplexity": 100
},
"monitoring": {
"metricsInterval": 1000,
"auditLevel": "detailed",
"retentionDays": 90
}
}
# Validate intent specification
./scripts/validate-intent.sh .agent/intents/INT-20250325-001.md
# Output: ✓ Valid or ✗ Errors with details
# Generate activity summary
./scripts/report.sh
# Example output:
# ═══════════════════════════════════════
# Intent Security Agent - Activity Report
# ═══════════════════════════════════════
#
# Active Intents: 3
# Total Violations: 12 (2 high, 5 medium, 5 low)
# Learnings Extracted: 8
# Strategies Evolved: 3
# Success Rate: 87%
./scripts/scaffold-run.sh examples/privacy-review pii_redaction high
Use this when you want a realistic working folder that captures:
Add to .claude/hooks.json:
{
"before_action": "bash ./scripts/validate-intent.sh"
}
Skill automatically integrates when installed via npx skills add.
Manual integration - use validation scripts before committing actions.
Now that you have the basics:
Check:
validate-intent.sh).agent/intents exists?)Check:
AGENT_LEARNING_ENABLED="true"?Check:
AGENT_AUTO_ROLLBACK="true"?