agent-self-governance

A data-driven approach to privacy-preserving ML: balancing the trade-off between privacy and performance through synthetic data generation and algorithmic sandboxing.

5|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/tiancaiamao/ai --skill agent-self-governance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-self-governance
Source: https://github.com/tiancaiamao/ai/tree/main/skills/agent-self-governance
Command: npx skills add https://github.com/tiancaiamao/ai --skill agent-self-governance

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents autonomous agents from losing important context, falsely claiming completion, drifting from their intended persona, and wasting tokens on low-value work.

Core Features & Use Cases

  • Write-Ahead Logging: Record corrections, decisions, analyses, and state changes before responding so critical context survives compaction.
  • Verification Before Reporting: Check file existence, recent modification, command success, or git status before saying a task is done.
  • Behavior and Cost Control: Track persona drift with anti-pattern scoring and evaluate whether an operation delivered enough value for its cost.
  • Infrastructure Knowledge Logging: Capture machine specs, service ports, and network details immediately so operational knowledge does not disappear.
  • Use Case: A coding agent can log a user correction, verify that a build or test actually passed, and retain local environment facts for future sessions.

Quick Start

Ask the agent to log the latest correction to WAL, verify the completed task with VBR, and report the current governance status.

Frequently Asked Questions about agent-self-governance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent my autonomous coding agent from losing context during long-running sessions?

Write-ahead logging persists corrections, decisions, and state changes to append-only JSONL logs before responding, ensuring critical context survives compaction. This allows autonomous coding agents to recover previous session state and retain operational knowledge.

How can I verify an AI coding agent actually completed a task before it reports success?

Verification before reporting uses shell-based checks to validate file existence, recent modification, command success, or git status. This mechanism ensures the agent confirms the task physically completed instead of falsely claiming completion.

What is the best way to track token cost and persona drift for an autonomous agent?

Behavior and cost control tracks persona drift using anti-pattern scoring and evaluates whether an operation delivered enough value for its token cost. This governance data keeps agent operations affordable and aligned with the intended persona.

How do I replay an autonomous agent's decisions and check its governance status?

Replay and status commands read the append-only JSONL logs to restore previous decisions and corrections. The governance status report surfaces current behavior metrics, verification records, and cost tracking data.

Does this agent governance approach require any external dependencies or databases?

No external dependencies are required. The approach relies solely on shell-based checks and append-only JSONL log files to keep governance data durable and actionable without needing a database.

When should I use write-ahead logging for an AI agent workflow?

Use write-ahead logging when an autonomous agent operates in long-running workflows where context compaction risks losing user corrections, infrastructure knowledge, or verification records. It captures machine specs and operational details immediately before context disappears.