Quick Start Guide

Get up and running with Intent Security Agent in 5 minutes.

Table of contents

  1. Installation
    1. Option 1: NPM Package (Recommended)
    2. Option 2: Clone Repository
  2. Basic Setup
    1. 1. Create Directory Structure
    2. 2. Set Environment Variables
    3. 3. Create Your First Intent
    4. 4. Or Scaffold a Full Run Folder
  3. Your First Validation
    1. Create Test Files
    2. Example: Allowed Action
    3. Example: Blocked Action
  4. Review Outcomes
    1. Check for Violations
    2. Check Learnings
    3. Generate Report
  5. Configuration File (Optional)
  6. Utilities
    1. Validate Intent Format
    2. Activity Report
    3. Scaffold a Conversation-Driven Run
  7. Integration with AI Agents
    1. Claude Code
    2. OpenClaw
    3. GitHub Copilot
  8. Next Steps
  9. Troubleshooting
    1. Issue: Validation not working
    2. Issue: No learnings extracted
    3. Issue: Rollback not triggered
  10. Getting Help

Installation

# Install skill
npx skills add nispatil/self-improving-intent-security-agent

Option 2: Clone Repository

# 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

Basic Setup

1. Create Directory Structure

# Create agent directories
mkdir -p .agent/{intents,violations,learnings,audit}

2. Set Environment Variables

# 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"

3. Create Your First Intent

# 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

4. Or Scaffold a Full Run Folder

If you want a transcript, report, and .agent artifacts together:

./scripts/scaffold-run.sh examples/my-demo customer_feedback medium

This creates:


Your First Validation

Create Test Files

# 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

Example: Allowed Action

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

Example: Blocked Action

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

Review Outcomes

Check for Violations

# View violations
cat .agent/violations/VIOLATIONS.md

# Find high-severity violations
grep -l "Severity**: high" .agent/violations/*.md

Check Learnings

# View learnings
cat .agent/learnings/LEARNINGS.md

# View evolved strategies
cat .agent/learnings/STRATEGIES.md

Generate Report

# Run report script
./scripts/report.sh

# Output shows:
# - Active intents
# - Recent violations
# - Learning progress
# - Success metrics

Configuration File (Optional)

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
  }
}

Utilities

Validate Intent Format

# Validate intent specification
./scripts/validate-intent.sh .agent/intents/INT-20250325-001.md

# Output: ✓ Valid or ✗ Errors with details

Activity Report

# 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%

Scaffold a Conversation-Driven Run

./scripts/scaffold-run.sh examples/privacy-review pii_redaction high

Use this when you want a realistic working folder that captures:


Integration with AI Agents

Claude Code

Add to .claude/hooks.json:

{
  "before_action": "bash ./scripts/validate-intent.sh"
}

OpenClaw

Skill automatically integrates when installed via npx skills add.

GitHub Copilot

Manual integration - use validation scripts before committing actions.


Next Steps

Now that you have the basics:

  1. View Demo Walkthrough - Interactive step-by-step examples
  2. Read Architecture - Understand system design
  3. Explore Examples - Real-world scenarios
  4. Join Discussions - Ask questions, share experiences

Troubleshooting

Issue: Validation not working

Check:

Issue: No learnings extracted

Check:

Issue: Rollback not triggered

Check:


Getting Help