Skip to content

The Security Guide

AI agent harnesses introduce a unique attack surface. Key vectors:

Malicious instructions embedded in code, comments, issues, or documentation that attempt to manipulate agent behavior.

Defenses:

  • ECC’s InsAIts security hook (opt-in via ECC_ENABLE_INSAITS=1)
  • Input validation in hooks
  • Secret scrubbing in hook outputs

Agents have access to powerful tools (file write, bash execution, git operations). Uncontrolled tool use can lead to:

  • Accidental file deletion
  • Credential exposure
  • Unauthorized git pushes

Defenses:

  • PreToolUse hooks that validate commands
  • Git push confirmation hooks
  • Dev server blockers (prevents npm run dev outside tmux)

Malicious content in the context window that influences agent decisions.

Defenses:

  • Session isolation
  • Context compaction with key-extraction
  • Verification loops

Run agents in isolated environments:

  • Docker containers - Full isolation for untrusted operations
  • Git worktrees - Filesystem isolation for parallel tasks
  • Tmux sessions - Process isolation for long-running commands

ECC installs security rules for each language ecosystem:

  • Input validation patterns
  • Authentication best practices
  • SQL injection prevention
  • XSS defense
  • Secret management
  • Dependency auditing

Use the harness audit command to score your security posture:

Terminal window
/harness-audit

This evaluates hook coverage, rule compliance, and MCP configuration security.

The ecc-agentshield npm package provides additional security layers for production agent deployments. It includes runtime monitoring, anomaly detection, and automated response capabilities.