
Agent Instinct System
Install this to layer automatic pre-action safety reflexes on your coding agent so budget caps, destructive ops, and protected files are checked before every change or tool call.
Install
npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill agent-instinct-systemWhat is this skill?
- Pre-cognitive reflexes that run before code changes, tool calls, and output generation
- Three-tier instinct model with instant zero-cost reflex checks at the base
- Automatic budget-cap validation before bid or spend-related API modifications
- Destructive operations gated on confirmation signals
- File deletion validated against protection lists without relying on agent memory
Adoption & trust: 1 installs on skills.sh; 18 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Journey fit
Ship/security is the canonical shelf because the skill’s purpose is enforcing invariants that must never be violated before changes reach production or live APIs. Security subphase fits pre-cognitive checks (budget caps, confirmations, deletion guards) that operate as a universal guardrail rather than a one-off audit.
Common Questions / FAQ
Is Agent Instinct System safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Agent Instinct System
# Agent Instinct System Part of [Agent Skills™](https://github.com/itallstartedwithaidea/agent-skills) by [googleadsagent.ai™](https://googleadsagent.ai) ## Description The Agent Instinct System implements pre-cognitive reflexes — automatic safety checks and validations that fire before every code change, tool call, or output generation. Just as biological reflexes protect organisms from harm faster than conscious thought, agent instincts protect codebases and systems from damage faster than deliberate reasoning. These instincts operate below the level of task-specific logic, forming a universal safety layer that activates regardless of what the agent is doing. Developed for the Buddy™ agent at [googleadsagent.ai™](https://googleadsagent.ai), where a single incorrect Google Ads API call could burn through a client's entire monthly budget, the instinct system enforces invariants that must never be violated. Budget caps are checked before bid modifications. Destructive operations require confirmation signals. File deletions are validated against protection lists. These checks happen automatically, without the agent needing to "remember" to perform them. The instinct system is organized into three tiers: reflexes (instant, zero-cost checks like "is this file in the protected list"), gates (lightweight validations like "does this change pass the linter"), and assessments (more expensive checks like "does this modification align with the stated task"). Each tier adds latency but catches increasingly subtle issues. ## Use When - Agents operate on production systems where mistakes have real consequences - You need defense-in-depth beyond what a single verification step provides - Multiple agents or team members work on the same codebase simultaneously - The agent handles destructive operations (deletions, deployments, API mutations) - Compliance requirements mandate pre-action validation for AI-generated changes - You want to prevent entire categories of mistakes rather than catching them after the fact ## How It Works ```mermaid graph TD A[Agent Intent] --> B[Tier 1: Reflexes] B -->|Block| C[Immediate Rejection] B -->|Pass| D[Tier 2: Gates] D -->|Block| E[Rejection + Guidance] D -->|Pass| F[Tier 3: Assessments] F -->|Block| G[Rejection + Alternative] F -->|Pass| H[Action Execution] H --> I[Post-Action Audit] I --> J[Instinct Learning] J --> K{New Pattern?} K -->|Yes| L[Add Reflex/Gate] K -->|No| M[Log + Continue] ``` When the agent forms an intent to act (write a file, call a tool, generate output), the intent passes through the instinct tiers sequentially. Tier 1 reflexes are hardcoded checks that execute in microseconds: protected file lists, forbidden operation patterns, budget ceiling checks. Tier 2 gates run lightweight validations: syntax checks, dependency verification, scope validation. Tier 3 assessments perform deeper analysis: task alignment verification, impact estimation, side-effect prediction. After execution, post-action audits feed back into the instinct system, allowing it to learn new protective patterns from near-misses. ## Implementation **Instinct Engine Core:** ```typescript type InstinctTier = "reflex" | "gate" | "assessment"; interface Instinct { name: string; tier: InstinctTier; check(intent: AgentIntent): Promise<InstinctResult>; } interface InstinctResult { allow: boolean; reason?: string; alternative?: string; } class InstinctEngine { private instincts: Map<InstinctTier, Instinct[]> = new Map([ ["reflex", []], ["gate", []], ["assessment", []], ]); register(instinct: Instinct): void { this.instincts.get(instinct.tier)!.push(instinct); } async evaluate(intent: AgentIntent): Promise<