Ward is a lightweight permission management system that protects your terminal interactions with AI assistants and human collaborators. It prevents unauthorized actions while providing intelligent guidance for the next steps.
In today's AI-driven development environment, tools like Claude, GitHub Copilot, and ChatGPT have become indispensable partners in coding. However, these powerful AI assistants sometimes attempt actions that could:
- β Delete important files by mistake
- β Modify system configurations unintentionally
- β Execute harmful commands with full system access
- β Access sensitive data beyond project boundaries
- β Make irreversible changes without human oversight
Ward acts as a intelligent safety layer that:
- β Protects your system from AI overreach
- β Guides AI assistants with clear constraints
- β Educates both AI and humans about safe operations
- β Maintains productivity while ensuring security
- Terminal Integration: Seamlessly integrates with your existing shell
- Command Filtering: Whitelist/blacklist dangerous commands automatically
- Directory Protection: Restrict AI access to sensitive system directories
- Real-time Monitoring: Track and log all AI-initiated actions
- Smart Suggestions: Provide safe alternatives to blocked operations
- Permission Prompts: AI assistants can ask for permission before actions
- Contextual Guidance: Intelligent hints about what operations are safe
- Progress Tracking: Monitor AI work progress with structured feedback
- Safe Experimentation: Allow AI to work within defined boundaries
- Zero Configuration: Works out of the box with sensible defaults
- Minimal Overhead: No noticeable impact on terminal performance
- Simple Setup: One-command installation and activation
- Cross-platform: Linux, macOS, and Windows support
# Claude wants to modify files - Ward checks permissions
claude> "I'll help you refactor the authentication module"
ward> β
Command allowed: ls, cat, grep, sed in src/auth/
ward> π― Suggestion: Use 'ward-cli handle add' to track this task
# Copilot attempts system-wide changes
copilot> "Let me update system configurations"
ward> β BLOCKED: System directory access denied
ward> π‘ Hint: Use 'ward-cli check /etc' to see what's allowed# New team member joins project
developer> "I'll clean up the project structure"
ward> β
Basic file operations allowed in current directory
ward> β οΈ WARNING: rm commands require explicit permission
ward> π Use 'ward-cli comment' to document destructive changes# Learning environment for students
student> "I want to understand system internals"
ward> π Safe exploration mode activated
ward> π Sensitive system areas protected
ward> π‘ Educational hints provided for each commandWard offers multiple installation methods. Choose the one that best fits your workflow:
# One-click installation with Claude Desktop integration
curl -sSL https://raw.githubusercontent.com/yamonco/ward/main/install.sh | bash
# Or clone and run the installer
git clone https://github.com/yamonco/ward.git
cd ward
./install.shChoose your preferred installation method:
# Install permanently with UV (system-wide)
uv tool install "git+https://github.com/yamonco/ward.git[mcp]"
# Commands available immediately after installation
ward --version
ward status
ward init
# π― Permanent Installation Benefits:
# β
Commands available immediately from PATH
# β
Fast execution (no re-download)
# β
Persistent across shell sessions
# β
Ideal for daily development# Run on-demand with UVX (no installation)
uvx --from git+https://github.com/yamonco/ward.git ward --version
uvx --from git+https://github.com/yamonco/ward.git ward status
uvx --from git+https://github.com/yamonco/ward.git ward init
# π― UVX Usage Benefits:
# β
No system changes required
# β
Always latest version
# β
Isolated from other tools
# β
Perfect for CI/CD and testing# UV (Permanent) - Automatic MCP setup
uv tool install "git+https://github.com/yamonco/ward.git[mcp]"
ward-mcp add --target claude-code
ward-mcp add --target claude-desktop
# UVX (Temporary) - Manual MCP setup
uvx --from git+https://github.com/yamonco/ward.git ward-mcp add --target claude-code
uvx --from git+https://github.com/yamonco/ward.git ward-mcp add --target claude-desktop# Clone the repository
git clone https://github.com/yamonco/ward.git
cd ward
# Run local installation script
./setup-ward.sh- β
Installs Ward to
~/.ward/(local only) - β
Creates local wrapper at
~/.local/bin/ward(optional) - β Sets up MCP server for AI integration
- β No global system changes
- β No PATH modifications
- β No system-wide installations
# Use Ward directly
~/.ward/ward --version
# Or add local bin to PATH (optional)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
ward --versionChoose your preferred installation method:
# Install Ward with MCP support permanently
uv tool install "git+https://github.com/yamonco/ward.git[mcp]"
# π― UV Benefits:
# β
Commands available immediately: ward, ward-mcp, ward-mcp-server
# β
Fast execution - no download delays
# β
Persistent across all shell sessions
# β
Perfect for daily development work# Create AI-ready project
mkdir ai-secure-project
cd ai-secure-project
# Set up AI-friendly policies
ward init
# Verify AI safety setup
ward status# Configure Claude Desktop/Claude Code for AI integration
ward-mcp add --target claude-code
ward-mcp add --target claude-desktop
# Check MCP installation status
ward-mcp status
# π‘οΈ Ward Environment Activation (Optional)
ward activate # Adds π‘οΈ to your prompt for visual indication# Create AI-ready project
mkdir ai-secure-project
cd ai-secure-project
# Set up AI-friendly policies with UVX (no installation)
uvx --from git+https://github.com/yamonco/ward.git ward init
# Verify AI safety setup
uvx --from git+https://github.com/yamonco/ward.git ward status
# π― UVX Benefits:
# β
No system changes required
# β
Always gets the latest version
# β
Isolated from other tools
# β
Perfect for CI/CD and testing environments# Configure Claude Desktop/Claude Code
uvx --from git+https://github.com/yamonco/ward.git ward-mcp add --target claude-code
uvx --from git+https://github.com/yamonco/ward.git ward-mcp add --target claude-desktop
# Check MCP status
uvx --from git+https://github.com/yamonco/ward.git ward-mcp status# Check policies for current directory
ward check # UV installed
# OR
uvx --from git+https://github.com/yamonco/ward.git ward check # UVX
# Your AI assistant now works within Ward's security boundaries!
# Claude, Copilot, and ChatGPT automatically receive guidance about allowed operations# Activate Ward environment for visual prompt distinction
ward activate
# Your prompt changes:
# Before: user@hostname:~/project$
# After: π‘οΈ user@hostname:~/project$
# Deactivate when done
ward deactivate# Claude wants to help with code refactoring
claude> "I'll analyze and improve your codebase structure"
ward> β
AI assistance mode activated
ward> π Current project: 15 files, 3 directories
ward> π― Safe operations: read, analyze, suggest modifications
ward> β Restricted: file deletion, system changes
# Claude gets intelligent guidance
ward> π‘ For refactoring, consider:
# 1. Read existing code with 'cat' and 'grep'
# 2. Create analysis file with suggestions
# 3. Use 'ward-cli handle add' to track changes# Copilot suggests system modifications
copilot> "Let me optimize your development environment"
ward> π Checking suggested commands...
ward> β οΈ Potentially risky: 'npm install -g some-package'
ward> π‘οΈ Protection: Requires manual confirmation
ward> π‘ Safer alternative: 'npm install --save-dev some-package'# ChatGPT explores your project
chatgpt> "I'll help you understand the codebase"
ward> π Project Analysis Mode: ON
ward> β
Allowed: 'find', 'grep', 'cat', 'head', 'tail'
ward> π Progress: 5/15 files analyzed
ward> π‘ Next suggestion: Check 'README.md' for project overview# AI Development Environment
echo "@description: AI-Optimized Development
@whitelist: ls cat pwd echo grep sed awk git python node npm yarn
@ai_whitelist: handle comment analyze suggest review
@ai_restrictions: no_file_deletion, no_system_access
@ai_guidance_level: detailed
@ai_operation_limit: 50" > .ward
# Learning Environment
echo "@description: Educational AI Sandbox
@whitelist: ls cat echo grep head tail wc find
@ai_mode: educational
@ai_explain_denials: true
@ai_suggest_alternatives: true
@ai_progress_hints: true" > .ward# Allow specific AI operations
ward-cli ai allow "file_modification" --scope "src/"
# Review AI activity
ward-cli ai audit --last 24h
# Set AI operation limits
ward-cli ai limit --operations 100 --timeframe "1 hour"# Ward automatically intercepts and guides AI commands
$ ai_assistant_suggests_delete_ward_config
ward> π« BLOCKED: Attempting to modify Ward configuration
ward> π‘ AI Assistant: This action requires explicit permission
ward> π To proceed: Use 'ward-cli ai override --confirm' with justification
# Ward provides safe alternatives
ward> β
Suggested safe alternative:
# - Review configuration with 'ward-cli config show'
# - Create backup with 'ward-cli export config-backup.json'
# - Submit change request with 'ward-cli ai request-change'# Track AI-assisted work
ward-cli ai track start "API refactoring" --model claude-3.5
ward-cli ai track add-file "modified auth.py" --ai-generated
ward-cli ai track add-comment "Improved error handling" --ai-explanation
ward-cli ai track complete --verified
# Generate AI work report
ward-cli ai report --format markdown --include-suggestions- Prevents accidental data loss from AI mistakes
- Blocks unauthorized system access attempts
- Provides educational feedback for AI learning
- Maintains audit trail of all AI operations
- Clear boundaries help AI work more effectively
- Intelligent suggestions speed up development
- Context-aware guidance reduces trial and error
- Safe experimentation encourages innovation
- Consistent AI behavior across team members
- Shared AI policies for project safety
- Centralized AI activity monitoring and review
- Onboarding assistance for new AI users
Ward now provides Model Context Protocol (MCP) integration, enabling direct communication with AI assistants through a standardized protocol.
MCP allows AI assistants to:
- Directly access Ward security tools without shell interaction
- Execute security operations through standardized API calls
- Receive real-time feedback on policy compliance
- Work more efficiently with built-in AI guidance
# Install Ward with MCP integration permanently
uv tool install "git+https://github.com/yamonco/ward.git[mcp]"
# π― What gets installed:
# β
Ward CLI (ward, ward-mcp, ward-mcp-server)
# β
MCP server for AI integration
# β
Required dependencies (mcp, fastmcp)
# β
Commands available immediately from PATH
# β
Persistent across shell sessions# Run Ward with MCP integration on-demand
uvx --from git+https://github.com/yamonco/ward.git ward-mcp status
# π― UVX Benefits:
# β
No installation required
# β
Always latest version
# β
Isolated execution
# β
Perfect for testing and CI/CDUV (Permanent):
ward-mcp add --target claude-code
ward-mcp add --target claude-desktopUVX (Temporary):
uvx --from git+https://github.com/yamonco/ward.git ward-mcp add --target claude-code
uvx --from git+https://github.com/yamonco/ward.git ward-mcp add --target claude-desktop# UV Installed
ward-mcp status
# UVX Temporary
uvx --from git+https://github.com/yamonco/ward.git ward-mcp status
# Show available MCP tools
ward-mcp info# Claude will now have access to Ward tools directly:
claude> ward_check ./src
claude> ward_status
claude> ward_create_policy --description "AI development" --ai_mode enabled
claude> ward_allow_operation --operation file_modification --justification "Bug fixes"# Any MCP-compatible AI can use Ward tools
from mcp import Client
async def use_ward():
client = Client()
# Check security policies
result = await client.call_tool("ward_check", {"path": "./src"})
print(result.content[0].text)
# Get system status
status = await client.call_tool("ward_status", {})
print(status.content[0].text)| Tool | Description | Use Case |
|---|---|---|
ward_check |
Check security policies for a path | Verify AI access before operations |
ward_status |
Get overall Ward system status | Monitor security state |
ward_validate |
Validate all security policies | Ensure policy consistency |
ward_allow_operation |
Allow specific AI operations | Grant temporary permissions |
ward_ai_log |
Get recent AI activity log | Monitor AI behavior |
ward_create_policy |
Create security policies | Set up project constraints |
{
"mcpServers": {
"ward-security": {
"command": "uvx",
"args": ["git+https://github.com/yamonco/ward.git", "ward-mcp-server"],
"description": "Ward Security System - AI Assistant Protection"
}
}
}# ward_mcp_client.py
import asyncio
from mcp import Client
class WardSecurityClient:
def __init__(self):
self.client = Client()
async def check_path(self, path: str):
"""Check if path is safe for AI operations"""
result = await self.client.call_tool("ward_check", {"path": path})
return result.content[0].text
async def create_safe_policy(self, description: str, ai_mode: str = "enabled"):
"""Create AI-safe policy"""
return await self.client.call_tool("ward_create_policy", {
"description": description,
"ai_mode": ai_mode,
"whitelist": ["ls", "cat", "grep", "python", "git"],
"ai_guidance": True
})- π Faster AI Response: Direct API calls without shell overhead
- π‘οΈ Enhanced Security: Policy validation at MCP level
- π Better Monitoring: Structured logging and audit trails
- π§ Flexible Integration: Works with any MCP-compatible AI
- β‘ Real-time Feedback: Immediate policy compliance checking
- MCP Protocol Specification
- Claude Desktop Integration Guide
- Ward MCP Tools Documentation
- MCP Client Examples
# Install Ward with MCP support and configure Claude Desktop automatically
ward-mcp install
# Add Ward to Claude Desktop (if already installed)
ward-mcp add
# Remove Ward from Claude Desktop
ward-mcp remove
# Check installation status
ward-mcp status
# Show available MCP tools
ward-mcp info# Update to latest version
uv tool install --force "git+https://github.com/yamonco/ward.git[mcp]"
# Uninstall completely
uv tool uninstall ward-security
# Check installed version
ward --version
# List installed UV tools
uv tool list | grep ward# No update needed - always gets latest version
# Just run the command to get latest features
# Clean UVX cache (if needed)
uvx --clear-cache
# Run specific version (if needed)
uvx --from git+https://github.com/yamonco/ward.git@v2.0.3 ward --version| Use Case | Recommendation | Why |
|---|---|---|
| Daily Development | UV Permanent | Fast execution, persistent, convenient |
| CI/CD Pipelines | UVX Temporary | No installation, always latest, isolated |
| Testing/Trying | UVX Temporary | Clean environment, easy cleanup |
| Team Setup | UV Permanent | Consistent environment, easy management |
| Single Project | Either | Depends on your workflow preference |
- Install Ward in your development environment
- Set up MCP integration with
ward-mcp add - Create AI-safe project policies with
ward init - Restart Claude Desktop to activate MCP integration
- Start collaborating with your AI assistants
- Monitor and refine AI interactions over time
We welcome contributions to enhance AI safety and collaboration! See our CONTRIBUTING.md for guidelines.
- Fork this repository
- Create a feature branch for AI enhancements
- Test thoroughly with various AI assistants
- Submit your Pull Request with AI use cases
This project is licensed under the MIT License. See the LICENSE file for details.
- GitHub Discussions - AI integration questions
- Issue reporting - Bug reports and feature requests
- AI safety discussions - AI security concerns
Ward is developed and maintained by yamonco with a focus on AI-human collaboration safety.
If Ward helps you work safely with AI assistants, please consider supporting us:
Your support helps us enhance AI safety features and maintain this essential tool for the AI-powered development community.
π€ Ward Security System - Your AI Assistant's Safety Co-pilot
