---
title: "Implementors Guide - VIBES Standard - itsavibe.ai"
description: "Integrate VIBES into your AI tool or agent. Implementation quickstart, data format reference, agent prompt integration, and testing guide for tool builders."
url: https://itsavibe.ai/implementors.html
---

Tool Builders & AI Agents

    

# Implement VIBES

    Integrate the VIBES standard into your AI tool or agent. Add transparency to every AI operation in *minutes*, not months.

    This guide covers implementing the core VIBES v1.3 data substrate and agent harness lifecycle hooks. For attestation integration see [VERIFY](https://itsavibe.ai/verify.html). For risk scoring integration see [PRISM](https://itsavibe.ai/prism.html). For agent governance see [EVOLVE](https://itsavibe.ai/evolve.html). For incident response & forensics see [TRACE](https://itsavibe.ai/trace.html).

    [Looking for user-facing installation guides? See User Getting Started →](https://itsavibe.ai/u-get-started.html)

            

        

    

    
    
        
            
                Why this matters
                

## Why Implement VIBES?

            

            // 01 — Why Implement VIBES?
        

        AI tools and agents are transforming how work gets done — from writing code to managing infrastructure to automating complex workflows. As adoption grows, so does the demand for transparency: what did the AI do? What prompted it? How did it reason about the task?

        
            
                

#### Differentiate Your Tool

                Transparency is becoming table stakes. Tools and agents that can prove their work will win enterprise adoption over those that can't.

            

            
                

#### Meet Compliance Demand

                Organizations in regulated industries need audit trails for AI-driven operations. VIBES gives them one in a standardized format.

            

            
                

#### Be the Tool That Proves Its Work

                When an issue is found in AI-generated output, VIBES lets users trace exactly which model, prompt, and reasoning produced it.

            

        

        
            

#### Implementation Effort & Producer vs. Consumer Split

            A basic **Low assurance Producer** implementation takes roughly **200 lines of code** — hook into your agent harness's lifecycle events, create three JSON files in `.ai-audit/`, and append to `annotations.jsonl` on each AI operation. Medium adds prompt capture (~50 more lines). High adds reasoning capture with optional compression (~100 more lines).

            **Architectural rule:** In-harness producers (such as `ClaudeCode-VIBES`, `Codex-VIBES`, `AntigravityCLI-VIBES`, and `Gemini-CLI-VIBES`) are *fail-open* (≤2s execution budget, always exit `0`) and only emit raw `.ai-audit/` files. Heavy operations — building the derived SQLite `audit.db` cache, computing 16-signal PRISM risk scores, signing DSSE envelopes, and running 19-detector TRACE forensic scans — are handled out-of-process by consumers ([vibecheck and vibetrace](https://itsavibe.ai/tooling.html)).

        

    

    
    
        
            
                Three steps to ship
                

## Implementation Quickstart

            

            // 02 — Implementation Quickstart
        

        A minimum viable VIBES implementation (Low assurance) requires three steps: create a config file, record environment context, and append annotations after each AI operation.

        
            
                

#### Create .ai-audit/config.json

                Initialize the audit directory with a configuration file declaring the assurance level. Create this file on first use if it doesn't exist.

            

            
                

#### Record environment context to manifest.json

                At session start, compute a SHA-256 hash of your tool and model identity, then write the environment context entry to the manifest. Reuse the same hash for all annotations in that session.

            

            
                

#### Append annotations to annotations.jsonl

                After each AI operation, append a line annotation record with the file path, line range, action type, environment hash, and timestamp. One line per annotation, append-only.

            

        

        
            

### Step 1: config.json (pseudocode)

            
                

```
// Create .ai-audit/config.json
if not exists(".ai-audit/"):
    mkdir(".ai-audit/")

if not exists(".ai-audit/config.json"):
    config = {
        "standard":         "VIBES",
        "standard_version": "1.3",
        "assurance_level":  "low",
        "project_name":     detect_project_name()
    }
    write_json(".ai-audit/config.json", config)
```

            

        

        
            

### Step 2: Environment context & manifest (pseudocode)

            
                

```
// On session start, record environment context
env_context = {
    "type":          "environment",
    "tool_name":     "YourTool",
    "tool_version":  "1.0.0",
    "model_name":    "claude-opus-4-5",
    "model_version": "20251101",
    "created_at":    now_iso8601()
}

// Compute hash (exclude created_at and null fields at every depth via strip_nulls = canonicalize, below; sort keys; no whitespace)
hashable = strip_nulls(remove_key(env_context, "created_at"))
canonical = json_serialize(hashable, sort_keys=true, compact=true)
env_hash = sha256_hex(canonical)

// Write to manifest if new
manifest = read_json(".ai-audit/manifest.json")
if env_hash not in manifest.entries:
    manifest.entries[env_hash] = env_context
    write_json_atomic(".ai-audit/manifest.json", manifest)
```

            

        

        
            

### Step 3: Line annotations & causal edges (pseudocode)

            
                

```
// After each code generation or file edit
annotation = {
    "type":             "line",
    "file_path":        "src/auth.py",
    "line_start":       1,
    "line_end":         45,
    "environment_hash": env_hash,
    "action":           "create",
    "timestamp":        now_iso8601(),
    "session_id":       session_id,
    "assurance_level":  "low"
}

// Compute content-derived SHA-256 annotation_id (canonical JSON minus annotation_id)
annotation_id = compute_annotation_id(annotation)
annotation["annotation_id"] = annotation_id

// Append annotation + mandatory caused_by edge as single lines to JSONL (atomic O_APPEND)
append_line(".ai-audit/annotations.jsonl", json_serialize(annotation))

edge = {
    "type":        "edge",
    "edge_type":   "caused_by",
    "source_ref":  annotation_id,
    "source_type": "annotation",
    "target_ref":  prompt_hash or command_hash or env_hash,
    "target_type": "context",
    "timestamp":   now_iso8601(),
    "session_id":  session_id
}
append_line(".ai-audit/annotations.jsonl", json_serialize(edge))
```

                Each record is a single JSON line. Every `line`, `function`, and `session` annotation includes a content-derived SHA-256 `annotation_id` so causal `edge` records and TRACE blast-radius graphs can reference it deterministically. Use atomic append operations (`O_APPEND` on POSIX) to support concurrent writers. Never modify or delete existing lines.

            

        

        
            

### Step 4: Compute content anchors (RECOMMENDED)

            
                When creating line or function annotations, read the annotated range and compute content anchors for rebase resilience:

                

```
// After identifying the annotated range
// 1. Compute file_content_hash = SHA-256 of the entire file
file_bytes = read_file(annotation.file_path)
annotation["file_content_hash"] = sha256_hex(file_bytes)

// 2. Extract anchor_context = first 3 lines of the range, max 256 bytes
range_lines = read_lines(annotation.file_path, annotation.line_start, annotation.line_end)
annotation["anchor_context"] = truncate(join(range_lines[:3], "\n"), 256)

// 3. Compute anchor_hash = SHA-256 of the full annotated content
annotated_content = join(range_lines, "\n")
annotation["anchor_hash"] = sha256_hex(utf8_encode(annotated_content))
```

                Content anchors enable re-matching annotations after line shifts from rebase, squash, or amend operations. The `file_content_hash` provides a fast-path: if the file is unchanged, line numbers are still valid and no anchor search is needed.

            

        

        
            

### Step 5: Compute PRISM Score (OPTIONAL)

            
                If `risk_scoring.enabled` in config.json, gather available signals and compute a PRISM score:

                

```
// Optional: compute PRISM score (Provenance & Risk Intelligence Scoring Model)
config = read_json(".ai-audit/config.json")

if config.risk_scoring and config.risk_scoring.enabled:
    signals = gather_signals(annotation, context)
    // Reference: weighted-average algorithm or custom function
    risk_factors = []
    for signal in signals:
        risk_factors.append({
            "signal": signal.name,
            "value":  signal.value,   // 0.0–1.0
            "weight": signal.weight,  // 0.0–1.0, sum to 1.0
            "reason": signal.reason   // optional explanation
        })
    annotation["risk_score"]   = weighted_average(risk_factors)
    annotation["risk_factors"] = risk_factors
```

                Store individual signal assessments in `risk_factors` for score transparency. Available signals depend on assurance level: Low has basic signals, Medium adds `prompt_token_count`, High adds `model_capability_tier`. For the full PRISM framework, see the [PRISM specification](https://itsavibe.ai/prism.html). PRISM is a standalone extension on top of VIBES.

            

        

        
            

### Adding Medium assurance (prompt capture)

            
                Medium assurance adds prompt context. Before sending a prompt to the model, hash and record it:

                

```
// Before sending prompt to model
prompt_context = {
    "type":                 "prompt",
    "prompt_text":           user_prompt,
    "prompt_type":           "user_instruction",
    "prompt_context_files":  ["src/auth.py", "src/models/user.py"],
    "created_at":            now_iso8601()
}

prompt_hash = compute_context_hash(prompt_context)
write_to_manifest_if_new(prompt_hash, prompt_context)

// Then include prompt_hash in annotations
annotation["prompt_hash"] = prompt_hash
```

                Prompt types: `user_instruction`, `edit_command`, `chat_message`, `inline_completion`, `review_request`, `refactor_request`, `other`.

            

        

        
            

### Adding High assurance (reasoning capture)

            
                High assurance adds chain-of-thought capture. After receiving the model's response, record its reasoning:

                

```
// After model response, capture reasoning
reasoning_context = {
    "type":                   "reasoning",
    "reasoning_text":          model_thinking_output,
    "reasoning_token_count":   count_tokens(model_thinking_output),
    "reasoning_model":         "claude-opus-4-5",
    "created_at":              now_iso8601()
}

// Size management: compress if > 10KB, external blob if > 100KB
if byte_size(reasoning_context.reasoning_text) > 102400:
    write_gzip_blob(".ai-audit/blobs/" + hash + ".json.gz", reasoning_context)
    reasoning_context.external = true
    reasoning_context.blob_path = "blobs/" + hash + ".json.gz"
    delete reasoning_context.reasoning_text
elif byte_size(reasoning_context.reasoning_text) > 10240:
    reasoning_context.reasoning_text_compressed = gzip_base64(reasoning_context.reasoning_text)
    reasoning_context.compressed = true
    delete reasoning_context.reasoning_text

reasoning_hash = compute_context_hash(reasoning_context)
write_to_manifest_if_new(reasoning_hash, reasoning_context)

// Include reasoning_hash in annotations
annotation["reasoning_hash"] = reasoning_hash
```

            

        

        
            

### Multi-agent implementation (delegation, edges, decisions)

            
                Multi-agent workflows require delegation records, edge emission, and decision tracking. These are mandatory at all assurance levels.

                

```
// 1. On delegation: create child session, emit delegation record
child_session_id = generate_uuid()

delegation = {
    "type":              "delegation",
    "parent_session_id": current_session_id,
    "child_session_id":  child_session_id,
    "timestamp":         now_iso8601(),
    "task_description":  "Implement authentication module",
    "delegated_files":   ["src/auth.rs", "src/middleware.rs"],
    "delegation_type":   "task"
}
append_line(".ai-audit/annotations.jsonl", json_serialize(delegation))

// Start child session with parent_session_id
child_session = {
    "type": "session", "event": "start",
    "session_id": child_session_id,
    "parent_session_id": current_session_id,
    "environment_hash": env_hash,
    "timestamp": now_iso8601()
}
append_line(".ai-audit/annotations.jsonl", json_serialize(child_session))
```

                

```
// 2. On file read: emit informed_by edge
// Links the resulting annotation to the file read context
edge = {
    "type":        "edge",
    "edge_type":   "informed_by",
    "source_ref":  annotation_id,          // the annotation that used this context
    "source_type": "annotation",
    "target_ref":  command_context_hash,   // the file read command context
    "target_type": "context",
    "timestamp":   now_iso8601(),
    "session_id":  current_session_id
}
append_line(".ai-audit/annotations.jsonl", json_serialize(edge))
```

                

```
// 3. On decision: create manifest entry, link via decision_hash
decision = {
    "type":           "decision",
    "decision_point": "Which auth strategy to use",
    "options": [
        {"id": "A", "description": "JWT", "pros": ["Stateless"], "cons": ["Revocation"]},
        {"id": "B", "description": "Sessions", "pros": ["Simple"], "cons": ["State"]}
    ],
    "selected":   "A",
    "rationale":  "JWT chosen for horizontal scalability",
    "confidence": "high",
    "created_at": now_iso8601()
}

decision_hash = compute_context_hash(decision)
write_to_manifest_if_new(decision_hash, decision)

// Reference in subsequent annotations
annotation["decision_hash"] = decision_hash
```

            

        

    

    
    
        
            
                Schema & storage
                

## Data Format Reference

            

            // 03 — Data Format Reference
        

        VIBES audit data lives in three files inside the `.ai-audit/` directory. All files are JSON and designed for git tracking.

        

```
// .ai-audit/ directory structure
project/
  .ai-audit/
    config.json          // Project configuration (assurance level, extensions)
    manifest.json        // Hash-to-context mappings (environment, prompt, reasoning)
    annotations.jsonl    // Append-only annotation log (line, function, session)
    audit.db             // Generated query database (gitignored)
    blobs/               // External storage for large entries (High assurance)
```

        

### Context Types

        The manifest stores five types of context entries, each identified by its canonical SHA-256 hash. Higher assurance levels capture additional context types.

        
            
                Low+
                

#### Environment

                Tool name, version, model name, version, parameters. **Required at all levels.**

            

            
                Low+
                

#### Command

                Shell commands, file operations, MCP tool calls. Includes `command_args` and `stdin_hash`.

            

            
                Low+
                

#### Decision

                Options weighed (`options[]`), selected choice, rationale, and confidence. **Required when options are evaluated.**

            

            
                Medium+
                

#### Prompt

                Full prompt text, type classification, `prompt_token_count`, and context files.

            

            
                High
                

#### Reasoning

                Chain-of-thought trace, token count, reasoning model. Supports inline gzip compression and external `blobs/`.

            

        

        
            

### Hash computation algorithm (recursive key sort + conformance vectors)

            
                Context hashes are the primary keys linking manifest entries to annotations. The hash algorithm ensures deterministic, content-addressed identifiers across languages (Rust, TypeScript, Python, Go).

                

```
// SHA-256 hash computation for context entries
function canonicalize(value):
    if is_object(value):
        // Recursively sort keys lexicographically at ALL nesting depths; omit null values
        return {k: canonicalize(value[k]) for k in sorted(value.keys()) if value[k] != null}
    if is_array(value):
        // Preserve array element order; recursively canonicalize elements
        return [canonicalize(item) for item in value]
    return value

function compute_context_hash(context):
    // 1. Remove the top-level created_at field
    without_ts = {k: v for k, v in context if k != "created_at"}

    // 2. Recursively sort all object keys & strip nulls
    hashable = canonicalize(without_ts)

    // 3. Serialize with compact separators: "," and ":" (no spaces)
    canonical = json_dumps(hashable, separators=(",", ":"))

    // 4. Encode as UTF-8 and compute 64-char lowercase hex SHA-256
    return sha256(utf8_encode(canonical)).hex()

// Content-derived annotation_id (remove ONLY annotation_id; retain explicit nulls)
function compute_annotation_id(record):
    without_id = {k: v for k, v in record if k != "annotation_id"}
    canonical = json_dumps(without_id, sort_keys=true, separators=(",", ":"))
    return sha256(utf8_encode(canonical)).hex()
```

                The first 16 hex characters may be used for display; the full 64-character hash is always authoritative. Validate your canonical serializer against the official test vectors in [conformance-vectors.json](https://itsavibe.ai/conformance-vectors.json) (especially critical for nested structures like `decision.options[]` and `model_parameters`).

            

        

        
            

### Annotation record schema

            
                The annotation log (`annotations.jsonl`) supports core provenance records (`line`, `function`, `session`, `edge`) alongside extension records (`delegation`, `outcome`, `incident`, `audit_log`):

                

```
// Line annotation (most common)
{
  "type":             "line",
  "annotation_id":    "1e6a4debe9ed3b77...", // required content-derived SHA-256
  "file_path":        "src/auth.py",        // relative, forward slashes
  "line_start":       1,                    // 1-based, inclusive
  "line_end":         45,                   // 1-based, inclusive
  "environment_hash": "e7a3f1b2...",        // required
  "command_hash":     "d4e5f6a7...",        // optional
  "prompt_hash":      "a1b2c3d4...",        // Medium+ only
  "reasoning_hash":   null,                  // High only
  "decision_hash":    "f8e9d0c1...",        // required when decision options weighed
  "action":           "create",             // create|modify|delete|review|rebase_remap|rebase_orphan
  "timestamp":        "2026-02-03T10:05:00Z",
  "commit_hash":      "abc123",             // required, backfilled on commit
  "session_id":       "550e8400-...",       // optional UUID
  "assurance_level":  "medium",
  "anchor_context":   "def validate_signup(email, password):\n    ...",  // optional
  "anchor_hash":      "a9b8c7d6...",        // optional
  "file_content_hash":"1a2b3c4d...",        // optional
  "risk_score":       0.42,                 // optional PRISM (0.0–1.0)
  "risk_factors":     [...],                 // optional [{signal, value, weight, reason?}]
  "quarantined":      false                 // optional TRACE containment flag
}
```

                

```
// Function annotation (same fields, different identifiers)
{
  "type":               "function",
  "file_path":          "src/auth.py",
  "function_name":      "validate_signup",
  "function_signature": "def validate_signup(email: str, password: str) -> bool",
  ...
}
```

                

```
// Session lifecycle records
{"type":"session", "event":"start", "session_id":"550e8400-...", "timestamp":"...", "environment_hash":"e7a3...", "assurance_level":"medium"}
{"type":"session", "event":"end", "session_id":"550e8400-...", "timestamp":"..."}
```

                **New Action Types:**

                
                    
- `rebase_remap` — Line/function annotation remapped after history rewrite. Must include `supersedes` edge to original.

                    
- `rebase_orphan` — Annotation could not be remapped — anchor not found in rewritten file.

                

            

        

        
            

### Manifest file structure

            
                

```
// .ai-audit/manifest.json
{
  "standard": "VIBES",
  "version":  "1.3",
  "entries": {
    "e7a3f1b2c4d5...": {
      "type":          "environment",
      "tool_name":     "Claude Code",
      "tool_version":  "1.5.2",
      "model_name":    "claude-opus-4-5",
      "model_version": "20251101",
      "created_at":    "2026-02-03T10:00:00Z"
    },
    "a1b2c3d4e5f6...": {
      "type":                "prompt",
      "prompt_text":          "Add input validation...",
      "prompt_type":          "user_instruction",
      "prompt_context_files": ["src/auth.py"],
      "created_at":           "2026-02-03T10:05:00Z"
    }
  }
}
```

                Entries are keyed by their SHA-256 hash. The hash is computed from the entry content (excluding `created_at`). Identical contexts produce identical hashes and are deduplicated automatically.

            

        

        
            

### JSONL format rules

            
                The annotation log uses JSONL (JSON Lines) format for append-only efficiency:

                
                    
- Each record MUST be a single line (no line breaks within a record)

                    
- Records are separated by `\n`

                    
- `null` values may be omitted or explicitly included. Annotation writers MUST include explicit `null` fields rather than omitting them, because `annotation_id` is computed over the record as stored.

                    
- You MUST append records — never modify or delete existing lines

                    
- Silently skip unrecognized record types when reading

                

            

        

        
            

### Edge record schema

            
                Edge records capture directed causal and dependency relationships between audit events. Edge tracking is **mandatory at all assurance levels** — tools MUST emit edge records to capture causal relationships.

                

```
// Edge record — appended to annotations.jsonl
{
  "type":        "edge",
  "edge_type":   "caused_by",             // caused_by | depends_on | informed_by |
                                          // delegated_to | supersedes | reviewed_by
  "source_ref":  "",       // annotation_id, context hash, or session_id
  "source_type": "annotation",            // annotation | context | session
  "target_ref":  "",        // annotation_id, context hash, or session_id
  "target_type": "context",               // annotation | context | session
  "timestamp":   "2026-02-18T14:00:00Z",  // ISO-8601
  "session_id":  "550e8400-...",          // optional UUID
  "metadata":    {}                       // optional object
}
```

                Edge types: `caused_by` (code generated from prompt), `depends_on` (explicit dependency), `informed_by` (context read), `delegated_to` (task delegation), `supersedes` (replacement), `reviewed_by` (review relationship).

            

        

        
            

### Delegation record schema

            
                Delegation records capture multi-agent orchestration metadata when a parent session spawns child sessions for task delegation.

                

```
// Delegation record — appended to annotations.jsonl
{
  "type":                     "delegation",
  "parent_session_id":         "parent-uuid",         // required UUID
  "child_session_id":          "child-uuid",          // required UUID
  "timestamp":                 "2026-02-18T14:00:00Z", // ISO-8601
  "task_description":          "Implement auth module",// optional string
  "delegated_files":           ["src/auth.rs"],       // optional array of file paths
  "delegation_type":           "task",                // task | review | test | refactor | research | other
  "parent_environment_hash":   "e7a3f1b2...",        // optional hash
  "child_environment_hash":    "b2c3d4e5..."         // optional hash
}
```

                Delegation types: `task` (implementation work), `review` (code review), `test` (test writing/running), `refactor` (refactoring), `research` (codebase/spec exploration), `other` (anything else).

            

        

        
            

### Decision context entry schema

            
                Decision context entries are structured records in the manifest created when the AI evaluates multiple approaches. Decision tracking is **mandatory at all assurance levels** when multiple options are considered.

                

```
// Decision context — stored in manifest.json entries
{
  "type":           "decision",
  "decision_point": "Which authentication strategy to use",
  "options": [
    {
      "id":          "A",
      "description": "JWT tokens",
      "pros":        ["Stateless", "Horizontal scaling"],
      "cons":        ["Token revocation complexity"]
    },
    {
      "id":          "B",
      "description": "Server sessions",
      "pros":        ["Simple revocation"],
      "cons":        ["Requires session store"]
    }
  ],
  "selected":       "A",                          // matches an option id
  "rationale":      "JWT chosen for horizontal scalability",
  "confidence":     "high",                       // high | medium | low
  "created_at":     "2026-02-18T14:00:00Z"       // ISO-8601
}
```

                The decision entry is stored in the manifest keyed by its content hash (excluding `created_at`). Subsequent annotations can reference it via the `decision_hash` field to link code changes back to the decision that motivated them.

            

        

        

### Content Anchoring Fields (Optional)

        Line and function annotations support optional content anchoring fields for rebase resilience:

        
            
                anchor_context
                optional
                First 3 lines of the annotated range at annotation time (max 256 bytes).
            

            
                anchor_hash
                optional
                SHA-256 of the annotated content at annotation time.
            

            
                file_content_hash
                optional
                SHA-256 of the entire file at annotation time.
            

        

        

### PRISM (Provenance & Risk Intelligence Scoring Model) — Optional Extension

        Annotations may include a normalized risk score and structured risk factors. For full risk scoring implementation details, see the [PRISM specification](https://itsavibe.ai/prism.html).

        
            
                risk_score
                optional
                Aggregate risk score (0.0–1.0) computed from available signals.
            

            
                risk_factors
                optional
                Array of [{signal, value, weight, reason?}] for score transparency.
            

        

        

### TRACE (Threat Response, Audit, Containment & Evidence) — Optional Extension

        Annotations and JSONL logs support forensic containment flags and incident lifecycle records consumed by `vibetrace`. For full incident response details, see the [TRACE specification](https://itsavibe.ai/trace.html).

        
            
                quarantined
                optional
                Boolean flag marking a `line` or `function` annotation as quarantined during active incident containment.
            

            
                type: "incident"
                optional
                JSONL record (`IncidentAnnotation`) tracking incident `open`, `contain`, `freeze`, and `close` events, matched IoC IDs (e.g., `PI-001`, `TA-002`), and blast-radius references.
            

        

    

    
    
        
            
                Lifecycle hooks & drop-in instructions
                

## For AI Agents & Harnesses

            

            // 04 — For AI Agents & Harnesses
        

        You can integrate VIBES into an AI coding agent in two complementary ways: **Native Lifecycle Hook Instrumentation** (used by our reference producers for Claude Code, OpenAI Codex CLI, Google Antigravity CLI, and Gemini CLI) or **Drop-In Prompt & Skill Instructions** (for any LLM agent or IDE assistant).

        
            

#### Approach 1: Native Lifecycle Hook Producers (Recommended for Harnesses)

            Modern agent harnesses expose structured `stdin`/`stdout` JSON lifecycle hooks that fire outside the LLM's context window. A VIBES hook producer reads the JSON event payload on `stdin`, snapshots or diffs affected files, appends records to `.ai-audit/`, and exits `0` within ≤2 seconds (fail-open). If the harness supports Model Context Protocol (MCP) servers, wrap stdio MCP commands with a transparent proxy (such as `vibes mcp-wrap`) to record external tool invocations as `command` manifest entries.

        

        
            

### Agent harness lifecycle hook mappings (Claude Code, Codex CLI, Antigravity CLI)

            
                Here is how our production harness packages map native lifecycle events to VIBES v1.3 operations:

                

```
// Cross-Harness Lifecycle Hook Matrix

1. CLAUDE CODE (.claude/settings.local.json — ClaudeCode-VIBES)
   SessionStart       → init .ai-audit/, write environment entry, append session start
   UserPromptSubmit   → hash prompt_text (Medium+), store prompt_token_count
   PreToolUse         → snapshot target file before Write / Edit / MultiEdit / Bash
   PostToolUse        → diff file, compute anchor_hash & line range, append line + edge
   SubagentStop       → emit EVOLVE delegation record & delegated_to edge for Task agent
   Stop               → capture reasoning trace (High), append session end, local cosign

2. OPENAI CODEX CLI (~/.codex/config.toml — Codex-VIBES, Codex 0.128–0.162+)
   SessionStart       → handles startup | resume | clear | compact | fork session sources
   SubagentStart      → correlate agent_id & agent_type, open child session_id
   UserPromptSubmit   → hash user prompt & context files into manifest.json
   PreToolUse / PermissionRequest → record sandbox command_args & pre-edit file snapshot
   PostToolUse        → emit line annotations, command_hash, and caused_by / informed_by edges
   PreCompact / PostCompact → preserve session lineage across context window compactions
   SubagentStop / Interrupt / Stop / SessionEnd → finalize delegation & close session

3. GOOGLE ANTIGRAVITY CLI (.agents/hooks.json — AntigravityCLI-VIBES, agy)
   SessionStart       → initialize .ai-audit/ & record agy environment hash
   PreInvocation      → capture user prompt hash before turn execution
   PreToolUse         → snapshot target file, return {"decision":"allow"} on stdout
   PostToolUse        → diff edits, record subagent delegations, append line + edge records
   PostInvocation     → capture model reasoning trace (High assurance)
   Stop               → emit session end record
   + vibes mcp-wrap   → transparent stdio proxy auditing external MCP server tool calls
```

            

        

        
            

#### Approach 2: One-File Agent Prompt & Skill Discovery Integration

            For agents without external hook scripts — or to instruct an LLM to emit `decision` entries directly — download [vibes-agent.md](https://itsavibe.ai/vibes-agent.md) (or discover it programmatically via [/.well-known/agent-skills/index.json](https://itsavibe.ai/.well-known/agent-skills/index.json) and [/llms.txt](https://itsavibe.ai/llms.txt)) and include it in your agent's instruction file.

        

        Compatible agent instruction & skill systems:

        
            `AGENTS.md` — Codex, Antigravity, Cursor & Zed

            `CLAUDE.md` — Claude Code (`vibes integrate`)

            `.agents/skills/` — Antigravity CLI & Agent Skills v0.2.0

            `.cursorrules` — Cursor

            `.windsurfrules` — Windsurf

            `copilot-instructions.md` — GitHub Copilot

        

        
            

### Agent behavior hook points

            
                VIBES defines eight hook points where an agent must perform audit operations:

                

```
// Agent lifecycle hooks

1. SESSION START
   Read config.json → compute environment hash → write to manifest → append session start record

2. PRE-GENERATION (Medium+)
   Compute prompt hash → write to manifest

3. COMMAND EXECUTION
   Compute command hash → write to manifest → include command_hash in annotations

4. POST-GENERATION
   Append line annotations → include environment_hash (always)
                             → include prompt_hash (Medium+)
                             → capture reasoning, include reasoning_hash (High)
                             → emit caused_by edge record (always)

5. DELEGATION
   Create child session with parent_session_id → emit delegation record
   → emit delegated_to edge record

6. FILE READ / CONTEXT GATHERING
   Emit informed_by edge record linking annotation to file read context

7. DECISION POINT
   Create decision manifest entry → compute decision_hash
   → reference via decision_hash in subsequent annotations

8. COMMIT-TIME (Required)
   Backfill commit_hash on annotations created since last commit
```

            

        

        
            

### What the agent file contains

            
                The [vibes-agent.md](https://itsavibe.ai/vibes-agent.md) file includes:

                
                    
- Assurance level definitions (Low, Medium, High)

                    
- Complete file layout (`.ai-audit/` directory structure)

                    
- Configuration schema with all fields and defaults

                    
- SHA-256 hash canonicalization rules with reference implementation

                    
- Manifest specification (all five context types: environment, command, decision, prompt, reasoning)

                    
- Annotation log format (line, function, session records)

                    
- Agent behavior hooks (session start through commit-time)

                    
- Hook points for edge emission, delegation recording, and decision tracking

                    
- Concurrency rules for parallel tool instances

                    
- Security considerations for prompt data in public repos

                    
- Complete Medium assurance example (config + manifest + annotations)

                

            

        

    

    
    
        
            
                Trust signal
                

## Tool Provider Cosigning

            

            // 05 — Tool Provider Cosigning
        

        Optional in VIBES 1.x, [tool provider cosigning](https://itsavibe.ai/verify.html#cosigning) lets your tool add a second signature to attestations, proving the audit data was generated by your tool in real time. This protects users against data fabrication, post-hoc editing, and tool impersonation.

        For full attestation implementation details, see the [VERIFY specification](https://itsavibe.ai/verify.html).

        
            

#### What Users Get

            When your tool cosigns, attestations are classified as **tool-corroborated** instead of just **self-attested**. This is the strongest trust signal in the VIBES system — it means an independent party (your tool) confirms the data is genuine. Registries, badges, and verification reports all display this trust tier.

        

        

### Implementation Steps

        
            
                

#### Generate a signing key pair

                Create an Ed25519 key pair for your tool. The private key stays in your infrastructure (server-side or secure enclave) and is never distributed to users.

            

            
                

#### Publish your public key

                Serve your current public key as bare SPKI PEM at the required well-known path `https://{toolDomain}/vibes/{toolName}.pub` — your domain plus your tool's lowercased name (e.g. `https://maestro.sh/vibes/maestro.pub`). Verifiers derive this URL from your tool's identity and pull the latest key automatically, using conditional GET (`ETag`/`Last-Modified`) to check freshness. Strongly recommended: also publish key endorsements (`{toolName}.pub.sig` + offline root key at `{toolName}.root.pub`) so a web-host compromise alone can't mint trusted keys. Optionally also serve a richer keyset at `/vibes/vibes-signing-keys.json` with validity windows and status.

            

            
                

#### Create a signing endpoint (recommended)

                Build an endpoint that accepts the in-toto statement (payload type + base64url payload), computes the DSSE PAE bytes, and returns an Ed25519 signature over them. This is privacy-preserving — your endpoint sees only file hashes and predicate metadata, never the audit files, prompts, or code. Users pass this URL via `--cosign-url`.

            

            
                

#### Sign at data-creation time

                The cosignature must be generated when your tool produces the audit data, not after the fact. This timing constraint is the core anti-fabrication property — it prevents users from obtaining your signature for data you didn't generate.

            

        

        
            

### Signing endpoint specification

            
                

```
// POST https://your-domain/api/vibes/cosign

// Request: the in-toto statement from the client tool
{
  "payload_type": "application/vnd.in-toto+json",
  "payload": "**"
}

// Response: signature and key metadata. The endpoint decodes the
// payload, computes PAE(payload_type, decoded bytes), and signs
// the PAE bytes — the same message every other signature covers.
{
  "keyid": "",
  "sig": "",
  "provider_name": "YourCompany",
  "tool_name": "YourTool"
}
```

                The endpoint receives hashes and metadata only, not the audit files. Do NOT sign a hash of the PAE — Ed25519 is not a pre-hash scheme, and standard DSSE verifiers check every signature against the full PAE bytes. Authenticate the request (e.g., via API key or session token) to prevent abuse. Rate limiting is recommended.
            
        

        
            

### Well-known key endpoint format (required .pub file)

            
                

```
// REQUIRED: https://{toolDomain}/vibes/{toolName}.pub
// Bare Ed25519 public key, SPKI PEM. Example: https://maestro.sh/vibes/maestro.pub
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEA...
-----END PUBLIC KEY-----

// During rotation overlap only, a second PEM block follows:
// first block = current key, second block = outgoing key.
```

                Rules: `{toolDomain}` is your canonical domain (no scheme, no trailing slash); `{toolName}` is your tool's name, lowercased, matching the `tool_name` your tool writes into VIBES audit data. The keyId (and version) of a published key is the SHA-256 of its DER encoding — a changed file means a new key. Serve `ETag` and/or `Last-Modified` so verifiers can revalidate with a cheap conditional GET. Verifiers retain every key they have ever pulled (indexed by content hash), so rotating a key out of the file never breaks verification of historical attestations — but keep the endpoint itself available for the lifetime of anything you signed.
                You may additionally serve an optional JSON keyset with richer metadata:
                

```
// OPTIONAL: https://{toolDomain}/vibes/vibes-signing-keys.json
{
  "provider": "YourCompany",
  "tool_name": "YourTool",
  "keys": [
    {
      "keyid": "your-tool-keyid-2026-01",
      "algorithm": "Ed25519",
      "public_key_pem": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----",
      "valid_from": "2026-01-01T00:00:00Z",
      "valid_until": "2027-01-01T00:00:00Z",
      "status": "active"
    }
  ],
  "rotation_policy": "Annual rotation. Retired keys remain listed for verification.",
  "updated_at": "2026-01-01T00:00:00Z"
}
```

                Requirements for both endpoints: HTTPS only, stable URLs for the lifetime of signed attestations, rotate keys at least annually. In the JSON keyset, keep retired keys listed with `status: "retired"`; in the `.pub` file, keep the outgoing key as the second PEM block for the full rotation-overlap window.
            
        

        
            

### Key endorsement & rotation flow (.pub.sig + .root.pub)

            
                Endorsement protects your users against a compromised web host or CDN publishing a rogue key in your name. Two static sibling files sit next to your `.pub`:
                

```
// RECOMMENDED: endorsement file + offline developer root key
https://{toolDomain}/vibes/{toolName}.pub.sig    // JSON endorsement file
https://{toolDomain}/vibes/{toolName}.root.pub   // root public key, bare SPKI PEM

// {toolName}.pub.sig format
{
  "version": 1,
  "endorsements": [
    {
      "keyid": "",
      "signed_by": "",
      "sig": "",
      "signed_at": ""
    }
  ]
}
```

                Generate a root keypair once** and keep the private half offline (hardware token, encrypted cold storage) — only its public half is ever published, at `.root.pub`. Every operational key you publish gets a root endorsement, and each rotation also gets a chain endorsement from the outgoing key.

                **Rotation flow:**

                

```
// Rotate your operational signing key
$ vibecheck keygen                     // 1. generate the new operational keypair
$ vibecheck key endorse                // 2. sign the new pubkey with the OUTGOING key AND the root key
// 3. publish together: new {toolName}.pub (new key first, outgoing key second),
//    updated {toolName}.pub.sig, unchanged {toolName}.root.pub
```

                Verifiers accept an unendorsed key on domain trust alone (recorded `unendorsed`), upgrade to `endorsed-chain` / `endorsed-root` when signatures verify, and **reject** any new key that a published `.pub.sig` fails to endorse — so once you publish endorsements, keep them current with every rotation.

            

        

        
            

### Alternative: local cosigning key

            
                If you distribute a signing key with your tool binary (simpler but harder to rotate), users can pass it directly:

                

```
// User runs vibecheck with local cosigning key
$ vibecheck attest --cosign-key /path/to/provider.key --cosign-keyid your-tool-keyid
```

                This approach is suitable for development/testing or tools that run fully offline. For production, the remote signing service is recommended because it keeps the private key server-side and supports key rotation without tool updates.

            

        

    

    
    
        
            
                Validate compliance
                

## Testing Your Implementation

            

            // 06 — Testing Your Implementation
        

        Use the [vibecheck CLI](https://itsavibe.ai/tooling.html) to validate your VIBES implementation. It checks file structure, hash integrity, schema compliance, and assurance level requirements.

        

```
// Install and run vibecheck
$ vibecheck

// Expected output for a passing Low assurance project:
VIBES Standard Compliance Check
Project: my-project
Assurance Level: low
Files found: config.json, manifest.json, annotations.jsonl
Hash integrity: PASS
Schema compliance: PASS
Result: PASS
```

        

### Common Implementation Mistakes

        
            
- Including `created_at` or `null` fields in hash computation — both must be excluded before hashing

            
- Using pretty-printed JSON for hash input — must use compact serialization (no whitespace: `","` and `":"`)

            
- Sorting only top-level keys before hashing — JSON object keys must be sorted **recursively at every nesting depth** (while preserving array order); test against [conformance-vectors.json](https://itsavibe.ai/conformance-vectors.json)

            
- Omitting `annotation_id` on `line` or `function` annotations — required in v1.1 so causal `edge` records and `vibetrace` blast-radius graphs can reference annotations

            
- Modifying existing annotation records — `annotations.jsonl` is strictly append-only; never edit or delete lines

            
- Using relative paths with backslashes — file paths must use forward slashes on all platforms

            
- Missing `environment_hash` on annotations — this field is required at all assurance levels

            
- Exiting non-zero or blocking in an agent harness lifecycle hook — producer hooks must be fail-open (always exit `0` within ≤2s) so an audit failure never breaks the user's coding agent

            
- Non-atomic manifest writes — use write-to-temp-then-rename for `manifest.json` and POSIX `O_APPEND` for `annotations.jsonl` to prevent corruption from concurrent subagents

            
- Not emitting `delegation` and `edge` records when spawning subagents — breaks multi-agent EVOLVE governance and TRACE forensic provenance chains

        

        
            

### What vibecheck validates at each level

            
                

```
// Validation checks by assurance level

All levels:
  [PASS] .ai-audit/ directory exists
  [PASS] config.json valid (standard, version, assurance_level, project_name)
  [PASS] manifest.json valid (standard, version, entries)
  [PASS] annotations.jsonl valid JSONL with unique annotation_id on annotations
  [PASS] All environment_hash, command_hash & decision_hash references resolve
  [PASS] Hash integrity: recursively sorted canonical SHA-256 matches manifest keys
  [PASS] Edge & delegation records reference valid annotation_id / session_id / context hashes

Medium+ adds:
  [PASS] Prompt entries present in manifest
  [PASS] All prompt_hash references resolve in manifest
  [PASS] prompt_text is non-empty

High adds:
  [PASS] Reasoning entries present in manifest
  [PASS] All reasoning_hash references resolve in manifest
  [PASS] reasoning_text or reasoning_text_compressed or external blob present
  [PASS] External blobs exist at declared blob_path
```

            

        

    

    
    
        
            
                Open standard
                

## Get Started

            

            // 07 — Get Started
        

        VIBES is an open standard. The spec, reference implementation, and validation tools are all freely available.

        
            

### Integrate VIBES Into Your Tool or Agent

            Whether you're building an AI coding assistant, an autonomous agent framework, a CI/CD plugin, or an audit platform — VIBES gives your users verifiable transparency with a standard data format. Add [tool provider cosigning](https://itsavibe.ai/verify.html#cosigning) to prove your tool generated the data.

            
                [Download Agent Instructions](https://itsavibe.ai/vibes-agent.md)
                [View Standard on GitHub](https://github.com/openasocket/itsavibe.ai)
            

        

        
            [The VIBES Standard](https://itsavibe.ai/standards.html)
            [VERIFY](https://itsavibe.ai/verify.html)
            [PRISM](https://itsavibe.ai/prism.html)
            [EVOLVE](https://itsavibe.ai/evolve.html)
            [TRACE](https://itsavibe.ai/trace.html)
            [vibecheck & vibetrace CLIs](https://itsavibe.ai/tooling.html)
            [Conformance Vectors](https://itsavibe.ai/conformance-vectors.json)
            [RFC Specification](https://itsavibe.ai/rfc-vibes.txt)
            [Readable Spec](https://itsavibe.ai/standards.md)
        

    

    
    
        
            
                Self-attestation
                

## Badges & Self-Attestation

            

            // 08 — Badges & Self-Attestation
        

        Use shields.io badges to communicate AI usage and attestation level in your projects. Add them to your README for transparency about AI involvement in your codebase.

        

### Badge Specification

        Each badge tier represents a different level of AI involvement:

        
            
                
                Light AI assistance

            

            
                
                Moderate AI assistance

            

            
                
                Mixed development

            

            
                
                Primarily AI-driven

            

            
                
                Mostly AI-generated

            

            
                
                Fully AI-generated

            

        

        Additional badge styles:

        
            
                
                General AI-Generated (blue)

            

            
                
                AI-Assisted (flat)

            

            
                
                General AI-Generated (dark)

            

        

        

### Add Badges to Your README

        Copy and paste these markdown snippets into your README.md file. Replace the percentage with your project's AI usage level.

        

#### Percentage badge:

        

```
[![AI-Generated](https://img.shields.io/badge/AI--Generated-90%25-ff69b4?style=flat-square)](https://itsavibe.ai)
```

        

#### General badge:

        

```
[![AI-Generated](https://img.shields.io/badge/AI--Generated-itsavibe.ai-0d6efd?style=for-the-badge)](https://itsavibe.ai)
```

        

#### AI-Assisted badge:

        

```
[![AI-Assisted](https://img.shields.io/badge/itsavibe.ai-AI--Assisted-0d6efd?style=flat-square)](https://itsavibe.ai)
```

        

#### Attestation badges:

        

```
[![Self-Attested](https://img.shields.io/badge/Attestation-Self--Attested-f0ad4e?style=flat-square)](https://itsavibe.ai)
[![Manually Validated](https://img.shields.io/badge/Attestation-Manually--Validated-0d6efd?style=flat-square)](https://itsavibe.ai)
[![Machine Validated](https://img.shields.io/badge/Attestation-Machine--Validated-28a745?style=flat-square)](https://itsavibe.ai)
```

        For details on attestation levels (Self-Attested, Manually Validated, Machine Validated), see the [VERIFY attestation levels](https://itsavibe.ai/verify.html#attestation-levels) section.

        

### Self-Attestation Logos

        Use our **itsavibe.ai** emblem in your `README.md` files to signal that your project is AI-generated or AI-assisted and governed by human security review.

        
            
                
                400×400 README Emblem

            

            
                
                Full-Size 1024×1024 Emblem

            

        

        

#### Self-attestation logo markdown:

        

```
[![Vibe Code — itsavibe.ai](https://itsavibe.ai/images/Vibe-Code-400x400.png)](https://itsavibe.ai)
```

        

#### How to Estimate Your AI Percentage

        Consider these factors when estimating:

        
            
- Lines of code generated by AI vs. written manually

            
- Architectural decisions made by humans vs. AI suggestions

            
- Amount of post-generation editing

            
- AI's role in debugging and optimization

        

    

    
    
        
            
                Three paths
                

## Three Ways to Make an Impact

            

            // 09 — Three Ways to Make an Impact
        

        Whether you want to join the community, build with the standard, or champion adoption — there's a path for you.

        
            
                

#### Join the Community

                Contribute to the VIBES specification, review implementation proposals, and help shape the standard. Report issues, submit PRs, and discuss architecture decisions with fellow implementors.

                [Get involved →](https://itsavibe.ai/about.html#community)
            

            
                

#### Build an Implementation

                You're in the right place. Start with the quickstart above, add VERIFY cosigning, PRISM scoring, or EVOLVE governance — and ship a tool that proves its work.

                [Back to quickstart →](#)
            

            
                

#### Champion the Standard

                Advocate for AI audit data in your organization. Help establish transparency as the baseline expectation for AI tools and agent workflows.

                [Resources →](https://itsavibe.ai/about.html#champion)
            

        

    

    
    
        
            
                Continue exploring
                

## Learn More

            

            // 10 — Learn More
        

        Understand the standard before implementing it. Start with the overview, then dive into the assurance level that matches your target audience.

        
            [Low Assurance](https://itsavibe.ai/vibes-low.html)
            [Medium Assurance](https://itsavibe.ai/vibes-medium.html)
            [High Assurance](https://itsavibe.ai/vibes-high.html)
            [Badges](#badges)
        

    

    [Back to Home](https://itsavibe.ai/home.html)

    
        © 2025-2026 itsavibe.ai. All rights reserved.
