Skip to content

Latest commit

 

History

History
1556 lines (1080 loc) · 112 KB

1.1.0.md

File metadata and controls

1556 lines (1080 loc) · 112 KB

Agent Plugins Specification

Spec Version: 1.1.0

Status: Working Draft

This document defines the canonical Agent Plugins Specification v1.1.0 for packaging reusable components that extend AI agents into distributable plugins.

Table of contents

  1. Status and version
  2. Conformance language
  3. Terminology
  4. Plugin package model
  5. Manifest
  6. Component discovery
  7. Component types
  8. Client extensions
  9. Environment variables and placeholder expansion
  10. Versioning
  11. Client conformance

Non-normative material

1. Status and version

This specification defines version 1.1.0 of the Agent Plugins format.

Clients and plugin packages claiming conformance MUST implement or follow the requirements in this document.

1.1 Governance model

Governance for the Agent Plugins project is defined separately from the portable package format in the Technical Charter.

2. Conformance language

In the normative sections of this document, the key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL are to be interpreted as described in RFC 2119 and RFC 8174 when, and only when, they appear in all capitals.

Appendix A and Design Decisions are non-normative. All other sections are normative.

3. Terminology

Term Meaning Description
Plugin Package unit A self-contained directory with a manifest and optional components.
Plugin root Filesystem root The top-level directory of a plugin package.
Manifest Metadata document A plugin.json file at the plugin root.
Assets directory Portable file root The top-level assets/ directory reserved for portable assets defined by this specification.
Component Plugin-provided unit A skill, MCP server entry, or hook handler supplied through a component type standardized by this specification.
Client Plugin runtime A tool that discovers, installs, loads, and executes plugin components.
Extension namespace Client-owned identifier A reverse-domain identifier used for client-specific configuration data or files.
Extension directory Client-owned file root A top-level directory whose name is exactly an extension namespace and whose contents are defined by that namespace's owning client.

4. Plugin package model

4.1 General requirements

  1. A plugin is a directory rooted at a single filesystem location.
  2. A plugin MUST include a manifest at plugin.json in the plugin root.
  3. When a client discovers, reads, or executes a file or directory supplied by the plugin package, the filesystem-resolved path MUST remain within the filesystem-resolved plugin root. Symlinks, junctions, reparse points, and equivalent filesystem mechanisms MAY resolve to targets within the plugin root, but clients MUST reject package paths that resolve outside it.
  4. A configuration field defined by this specification as a plugin-relative path MUST begin with ./, be resolved against the plugin root, and remain within the filesystem-resolved plugin root after resolution.
  5. Configuration values not defined as paths, including command arguments and environment variable values, are opaque strings. Clients MUST NOT interpret them as package paths for the purpose of enforcing this section.

Example: valid and invalid relative paths

{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/mcp.schema.json",
  "mcpServers": {
    "server": {
      "type": "stdio",
      "command": "./bin/server",
      "cwd": "./data"
    }
  }
}
{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/mcp.schema.json",
  "mcpServers": {
    "server": {
      "type": "stdio",
      "command": "../bin/server",
      "cwd": "data"
    }
  }
}

The first example is valid — both paths start with ./ and stay within the plugin root. The second is invalid — ../bin/server escapes the plugin root and data is not a plugin-relative path.

These containment rules govern access to files supplied by the plugin package. They do not sandbox a plugin subprocess or restrict paths supplied at runtime. §7.2.1 separately defines containment for a configured working directory rooted in the client-managed PLUGIN_DATA directory.

When a path fails a containment requirement, the client MUST apply the narrowest applicable failure boundary:

  1. If plugin.json does not resolve within the plugin root, the client MUST reject the plugin.
  2. If a fixed component location does not resolve within the plugin root, the client MUST treat that component type as invalid under §6.2.
  3. If a discovered SKILL.md does not resolve within the plugin root, the client MUST skip that skill under §7.1.
  4. If an MCP server command or cwd fails containment, the client MUST treat that server entry as invalid under §7.2.2.
  5. If a hook handler command fails containment, the client MUST treat that handler as invalid under §7.3.2.
  6. For any other package path that resolves outside the plugin root, the client MUST deny access to that path.

4.2 Standard layout

A plugin that has skills, MCP servers, hooks, and a client extension can have the following layout:

my-plugin/
├── plugin.json
├── assets/
│   └── icon.png
├── skills/
│   └── summarize/
│       ├── SKILL.md
│       ├── scripts/
│       │   └── analyze.sh
│       └── references/
│           └── checklist.md
├── mcp.json
├── hooks.json
├── hooks/
│   └── check-tool-policy
├── com.example.client/
│   └── hooks/
├── LICENSE
└── CHANGELOG.md

See also: §4.3 Portable assets for icon discovery, §5 Manifest for manifest rules, §6 Component discovery for fixed component locations and missing-location behavior, and §8 Client extensions for client extension conventions.

4.3 Portable assets

The top-level assets/ directory is optional and reserved for portable assets defined by Agent Plugins. A plugin MUST NOT contain files or directories within assets/ except at paths defined by the Agent Plugins version it targets. Clients MUST ignore unrecognized contents. Client-specific files belong in their extension directory under §8, not in assets/.

4.3.1 Plugin icon

Clients are not required to display plugin icons. A client that displays plugin icons MUST discover icon candidates according to this subsection and MUST support PNG. It MAY support additional image formats, including SVG. The remaining client requirements in this subsection apply only to clients that display plugin icons.

An icon candidate is a regular file directly within the root assets/ directory whose filename is entirely lowercase and consists of the basename icon followed by one image-format extension recognized by the client.

Examples of icon candidates when the client recognizes their formats:

assets/icon.png
assets/icon.svg
assets/icon.webp

These paths are not icon candidates:

assets/icons/icon.png
assets/icon.png.backup
assets/Icon.png
assets/icon.PNG

A plugin that provides one or more icon candidates SHOULD include assets/icon.png. It MAY provide candidates in additional formats, but only PNG has guaranteed format support among clients that display plugin icons. All candidates provided by a plugin SHOULD be semantically equivalent representations of the same generic icon. Agent Plugins assigns no different theme, size, or purpose semantics based on image format. When multiple usable candidates are present, a client MAY select any of them.

A client MUST ignore an icon candidate it cannot safely read, decode, or render and continue considering other candidates. If the client supports none of the provided formats or no candidate is usable, it MUST behave as though the plugin provides no icon. Icon discovery or rendering failure MUST NOT invalidate the plugin or affect component discovery, loading, or execution.

A client that renders SVG icons MUST prevent them from executing active content or loading external resources.

This specification imposes no required icon dimensions or aspect ratio. For PNG icons, a square 512×512 canvas is recommended. The icon should remain recognizable when rendered at approximately 16×16 pixels. Simple shapes, appropriate padding, and contrast on both light and dark backgrounds help one generic icon work in marketplace-style interfaces and compact inline contexts.

5. Manifest

5.1 Location and loading

Clients MUST check for a manifest at plugin.json in the plugin root.

The Agent Plugins core specification defines exactly one portable manifest per plugin. No other file can replace, supplement, or override the core fields in root plugin.json.

A client loads and validates root plugin.json before discovering components or applying client-specific behavior.

See also: §11 Client conformance for requirements around supporting plugin.json.

5.2 Manifest object

The manifest MUST be JSON and MUST contain a top-level object. Its schema is closed: the only permitted top-level fields are $schema, name, displayName, version, description, author, homepage, repository, license, keywords, and extensions.

If plugin.json contains any other top-level field, it does not conform to the schema. Clients MUST report and ignore each unknown field and MUST continue loading the plugin if the manifest otherwise satisfies this section. Clients MUST NOT assign semantics to unknown fields. Client-specific manifest data belongs under extensions as defined in §8.

Every permitted field MUST match the type and constraints defined below. Any schema violation other than an unknown top-level field is fatal: the client MUST reject the plugin and MUST NOT discover or execute any of its components.

The official machine-readable schema is schemas/1.1.0/plugin.schema.json. The specification text is authoritative if it conflicts with the schema.

The required $schema field identifies the Agent Plugins specification version targeted by the plugin and its corresponding manifest schema. For Agent Plugins 1.1.0, its value MUST be the canonical identifier https://agent-plugins.org/schemas/1.1.0/plugin.schema.json.

Clients MUST use a recognized $schema value to select locally supported manifest validation and interpretation rules. A client MAY map multiple canonical identifiers to the same implementation only when it explicitly recognizes those Agent Plugins versions as compatible. Clients MUST NOT retrieve a schema while loading a plugin. If a client does not support the declared Agent Plugins version or an explicitly recognized compatible version, it MUST reject the plugin and SHOULD report the unsupported version.

Example: minimal manifest

{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/plugin.schema.json",
  "name": "minimal-plugin"
}

Example: full manifest

{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/plugin.schema.json",
  "name": "plugin-name",
  "displayName": "Plugin Name",
  "version": "1.2.0",
  "description": "Brief plugin description",
  "author": {
    "name": "Author Name",
    "email": "author@example.com",
    "url": "https://example.com"
  },
  "homepage": "https://docs.example.com/plugin",
  "repository": "https://github.com/example/plugin",
  "license": "MIT",
  "keywords": ["keyword1", "keyword2"],
  "extensions": {
    "com.example.client": {
      "setting": true
    }
  }
}

5.3 Required fields

Field Type Description
$schema string Canonical plugin manifest schema identifier defined in §5.2.
name string Portable plugin name.

If a required field is missing, has the wrong type, is empty, or otherwise violates its requirements, the manifest is invalid. Clients MUST reject the plugin and MUST NOT discover or execute any of its components. Clients SHOULD report which required field is invalid.

5.4 Metadata fields

Field Type Description
version string Version string (Semantic Versioning RECOMMENDED). Used for update checks and cache freshness.
displayName string Human-readable plugin name for presentation.
description string Short description of plugin purpose.
author object Author object with optional name, email, and url string fields.
homepage string Documentation or homepage URL.
repository string Source repository URL.
license string License identifier (SPDX identifier RECOMMENDED).
keywords string[] Search and discovery tags.

The optional displayName field provides a human-readable plugin name for presentation. A client that presents a human-readable plugin name SHOULD use displayName when present, but MAY use name instead when displayName is unsuitable for the presentation context, such as when it is empty or contains only whitespace.

The author object MAY contain only the name, email, and url fields, each with a string value. Any other field or value type makes the manifest invalid.

Except where this specification states an explicit constraint, metadata fields are validated only by their JSON types. Clients MUST NOT reject a manifest solely because version is not valid Semantic Versioning; homepage, repository, or author.url is not a recognized URL; author.email is not a recognized email address; or license is not an SPDX identifier.

5.5 Plugin name constraints

The manifest name value MUST satisfy all of the following:

Constraint Requirement Description
Length 1-64 characters The name MUST be between 1 and 64 characters inclusive.
Character set a-z, 0-9, -, . Lowercase alphanumeric characters, hyphens, and periods only.
Start and end Alphanumeric The first and last characters MUST be alphanumeric.
Repetition No -- or .. Consecutive hyphens and consecutive periods are not allowed.

Periods are allowed in plugin names.

Valid names: my-plugin, acme.tools, lint3r, a

Invalid names: My-Plugin (uppercase), -start (leading hyphen), has--double (consecutive hyphens), too.many..dots (consecutive periods), `` (empty)

5.6 Extensions field

The optional extensions field contains client-specific manifest data keyed by extension namespace. See §8 for processing rules.

6. Component discovery

See also: §4 Plugin package model for directory layout conventions.

6.1 Fixed locations

Clients MUST discover each supported component type from its fixed location. plugin.json cannot override these locations or contain inline component configuration.

Component locations:

Component type Fixed location Pattern
Skills skills/ Subdirectories containing SKILL.md
MCP servers mcp.json JSON configuration
Hooks hooks.json JSON configuration

Example: given a plugin reports-plugin with this layout:

reports-plugin/
├── plugin.json
├── skills/summarize/SKILL.md
├── mcp.json
└── hooks.json

The client discovers skill summarize from skills/, MCP servers from mcp.json, and hook handlers from hooks.json.

6.2 Missing locations

If a fixed component location is absent, the client MUST NOT treat that as an error.

If a fixed component location is present but does not resolve to the expected filesystem kind — for example, skills does not resolve to a directory or mcp.json or hooks.json does not resolve to a regular file — the client MUST treat that component type as invalid and continue loading other supported component types.

7. Component types

See also: §6 Component discovery for how component files are located.

The portable component types defined by this specification are skills, MCP servers, and hooks. Other component types are outside the portable format and do not affect conformance.

Clients MUST ignore component types they do not support.

7.1 Skills

Agent Skills MUST conform to the Agent Skills specification. That specification is the source of truth for the SKILL.md format, frontmatter fields, and directory layout (scripts/, references/, assets/).

This specification defines how Agent Skills are discovered within a plugin, not the skill format itself or how clients expose skills to users or models.

The fixed discovery location is skills/. Each immediate child directory containing a path named exactly SKILL.md that resolves to a regular file is treated as one skill. Clients MUST NOT recursively search deeper descendants for additional skills.

If a discovered skill does not conform to the Agent Skills specification, the client MUST skip that skill and continue loading other skills and component types. The client SHOULD report the invalid skill.

Example: a skill directory named deploy inside skills/:

skills/
└── deploy/
    ├── SKILL.md          # name: deploy
    ├── scripts/
    │   └── rollback.sh
    └── references/
        └── runbook.md

7.2 MCP servers

The Model Context Protocol specification defines MCP wire behavior and lifecycle semantics. Agent Plugins defines the mcp.json configuration format used to locate and connect to MCP servers in a plugin. Clients map this portable format to their native configuration; its field names and values need not match a client-native format.

7.2.1 Discovery and configuration

The MCP configuration path is mcp.json at the plugin root. MCP configuration MUST NOT be declared inline in plugin.json or loaded from any alternative core path.

mcp.json MUST be a JSON object containing the required $schema and mcpServers fields, with no other top-level fields. mcpServers MUST be an object whose member names identify servers and whose member values are server configuration objects. An empty mcpServers object is valid.

The official machine-readable schema is schemas/1.1.0/mcp.schema.json. The specification text is authoritative if it conflicts with the schema. The schema exposes #/$defs/server so that clients can validate each server independently and preserve the failure boundaries in §7.2.2.

The required $schema field identifies the Agent Plugins specification version targeted by the MCP configuration and its corresponding MCP schema. For Agent Plugins 1.1.0, its value MUST be the canonical identifier https://agent-plugins.org/schemas/1.1.0/mcp.schema.json.

Clients MUST use a recognized $schema value to select locally supported MCP configuration validation and interpretation rules. A client MAY map multiple canonical identifiers to the same implementation only when it explicitly recognizes those Agent Plugins versions as compatible. Clients MUST NOT retrieve a schema while loading a plugin.

Each server configuration MUST contain a type field and match exactly one of the closed variants below. An unknown field, an unknown type value, or a field belonging to another variant makes that server entry invalid.

Each variant permits an optional extensions field for client-specific server data, as defined in §8.1.

stdio
Field Type Required Description
type "stdio" Yes Selects the MCP stdio transport.
command string Yes Executable token to launch.
args string[] No Arguments passed to the executable.
env object of strings No Environment variables supplied to the process.
cwd string No Working directory for the process.
extensions object No Client-specific server data keyed by extension namespace.

The command field MUST contain a single executable token, not a shell command string. It MUST be either a bare executable name or a plugin-relative path beginning with ./. Clients MUST resolve bare names using the platform's executable search rules and MUST resolve plugin-relative paths against the plugin root. Clients MUST NOT perform placeholder expansion in command.

Whether a configured PATH environment value participates in resolving a bare command is client-defined. Plugins claiming conformance MUST NOT depend on that behavior. A plugin that bundles an executable in the package MUST use a plugin-relative command.

Clients MAY use a platform-specific command interpreter when required to launch the resolved executable, such as a .bat or .cmd script on Windows, but MUST preserve command as one token and pass args separately.

When cwd is omitted, clients MUST use the plugin root as the subprocess working directory. When present, cwd MUST have one of these forms:

  1. A plugin-relative path beginning with ./.
  2. Exactly ${PLUGIN_ROOT} or a path beginning with ${PLUGIN_ROOT}/.
  3. Exactly ${PLUGIN_DATA} or a path beginning with ${PLUGIN_DATA}/.

Clients MUST expand placeholders before resolving cwd. A plugin-relative or ${PLUGIN_ROOT}-rooted value MUST remain within the filesystem-resolved plugin root. A ${PLUGIN_DATA}-rooted value MUST remain within the filesystem-resolved plugin data directory. Any other form or any post-resolution escape makes that server entry invalid under §7.2.2.

The args, env, and cwd fields in a stdio server configuration MUST support ${PLUGIN_ROOT} and ${PLUGIN_DATA} expansion.

Streamable HTTP and legacy HTTP+SSE
Field Type Required Description
type "streamable-http" or "sse" Yes Selects the remote MCP transport.
url string Yes MCP endpoint URL.
headers object of strings No Fixed HTTP headers sent when connecting to the configured origin.
extensions object No Client-specific server data keyed by extension namespace.

streamable-http selects the current MCP Streamable HTTP transport. sse selects the deprecated HTTP+SSE transport defined by the MCP 2024-11-05 specification; it does not refer to SSE responses or streams used within Streamable HTTP.

The url value MUST be an absolute HTTP or HTTPS URL and MUST NOT contain user information or a fragment. Non-loopback endpoints MUST use HTTPS. HTTP MAY be used when the URL host is exactly localhost or an IP literal in a loopback range.

Header names and values MUST be valid HTTP header fields. Header names are case-insensitive; an entry containing the same header name more than once under different casing is invalid. Clients MUST NOT perform placeholder or environment-variable expansion in url, header names, or header values.

Header values are visible package data, not a portable secret mechanism. Plugins MUST NOT embed credentials or other secrets in headers. Headers generated by the client to implement HTTP, MCP, or authorization take precedence over configured headers with the same case-insensitive name. A client MUST NOT forward configured headers to a different origin through a redirect or legacy SSE endpoint event without explicit user authorization.

This specification defines no OAuth configuration or portable credential-reference fields. Authorization discovery, user interaction, and credential storage are client-managed. An authorization failure is a connection failure for that server, not invalid plugin configuration.

Transport support

A client that supports Agent Plugins MCP servers MUST support at least one of stdio or streamable-http and SHOULD support both. Support for sse is OPTIONAL. A client MUST use the transport declared by type for its initial connection attempt. Agent Plugins does not define fallback behavior if that attempt fails.

Example: mcp.json

{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/mcp.schema.json",
  "mcpServers": {
    "local-validator": {
      "type": "stdio",
      "command": "./bin/validator",
      "args": ["--data", "${PLUGIN_DATA}/validator"],
      "env": {
        "CONFIG": "${PLUGIN_ROOT}/config.json"
      },
      "cwd": "${PLUGIN_ROOT}"
    },
    "deployment-api": {
      "type": "streamable-http",
      "url": "https://deploy.example.com/mcp",
      "headers": {
        "X-Tenant": "public-tenant"
      }
    },
    "legacy-events": {
      "type": "sse",
      "url": "https://legacy.example.com/sse"
    }
  }
}

7.2.2 Loading rules

  1. Clients that support MCP servers MUST load configuration only from mcp.json at the plugin root.
  2. If mcp.json is not valid JSON, targets an Agent Plugins version for which the client has no supported or explicitly recognized compatible version, targets a different Agent Plugins version than plugin.json, or does not satisfy the other top-level requirements in §7.2.1, the client MUST disable MCP for that plugin and continue loading other component types. The client SHOULD report the invalid, unsupported, or mismatched configuration.
  3. If an individual server entry does not satisfy the requirements in §7.2.1, the client MUST skip that server and continue loading other servers and component types. The client SHOULD report the invalid entry.
  4. If the client does not support the transport declared by an otherwise valid server entry, it MUST skip that server and continue loading other servers and component types. The client SHOULD report the unsupported transport.
  5. If a server fails to start, connect, authenticate, or complete the MCP handshake, the client MUST continue loading other servers and component types. The client SHOULD report the connection failure.

7.3 Hooks

Hooks run plugin-provided commands at defined points in a client's agent loop. Each hook event and its semantics are defined below.

Clients map portable events and results into their agent loops. Outside the portable contract, this specification does not define client-specific hook names, tool names or inputs, permission systems, diagnostics, or other client behavior.

7.3.1 Discovery and configuration

The hooks configuration path is hooks.json at the plugin root. Hook configuration MUST NOT be declared inline in plugin.json or loaded from any alternative core path.

hooks.json MUST be a JSON object containing the required $schema and hooks fields, with no other top-level fields. hooks MUST be an object whose member names identify hook events and whose member values are nonempty arrays whose elements configure handlers. An empty hooks object is valid.

The official machine-readable schema is schemas/1.1.0/hooks.schema.json. The specification text is authoritative if it conflicts with the schema. The schema exposes #/$defs/handlers, #/$defs/handler, and event input and output definitions so that clients can validate configuration entries, event inputs they produce, and handler results they consume while preserving the failure boundaries in §7.3.2. Event input definitions are version-specific producer schemas; handler acceptance is governed by §7.3.3.

The required $schema field identifies the Agent Plugins specification version targeted by the hooks configuration and its corresponding hooks schema. For Agent Plugins 1.1.0, its value MUST be the canonical identifier https://agent-plugins.org/schemas/1.1.0/hooks.schema.json.

Clients MUST use a recognized $schema value to select locally supported hooks validation and interpretation rules. A client MAY map multiple canonical identifiers to the same implementation only when it explicitly recognizes those Agent Plugins versions as compatible. Clients MUST NOT retrieve a schema while loading a plugin.

Each handler is a closed object with the following fields:

Field Type Required Description
command string Yes Executable token to launch.
args string[] No Arguments passed to the executable.
extensions object No Client-specific handler settings. See §8.1.

Each array element configures an independent handler.

The optional extensions field contains client-specific settings for that handler, keyed by extension namespace as defined in §8.1. Client-specific handler settings MUST preserve the portable hook requirements in §7.3.

The command field MUST contain a single executable token, not a shell command string. It MUST be either a bare executable name or a plugin-relative path beginning with ./. Clients MUST resolve bare names using the platform's executable search rules and MUST resolve plugin-relative paths against the plugin root. Clients MUST NOT perform placeholder expansion in command.

The args field MUST support ${PLUGIN_ROOT} and ${PLUGIN_DATA} expansion.

A bare command creates an external runtime dependency and may not resolve on every client platform. A plugin that bundles an executable in the package MUST use a plugin-relative command.

Clients MAY use a platform-specific command interpreter when required to launch the resolved executable, such as a .bat or .cmd script on Windows, but MUST preserve command as one token and pass args separately.

Example: hooks.json

{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/hooks.schema.json",
  "hooks": {
    "SessionStart": [
      {
        "command": "./hooks/load-session-context"
      }
    ],
    "UserPromptSubmit": [
      {
        "command": "./hooks/check-request"
      }
    ],
    "PreToolUse": [
      {
        "command": "./hooks/check-tool-policy",
        "args": [
          "--policy",
          "${PLUGIN_ROOT}/config/tool-policy.json",
          "--state-dir",
          "${PLUGIN_DATA}/tool-policy"
        ]
      }
    ],
    "PostToolUse": [
      {
        "command": "./hooks/review-tool-result"
      }
    ],
    "Stop": [
      {
        "command": "./hooks/check-completion"
      }
    ]
  }
}

Example: a handler with client-specific settings

{
  "command": "./hooks/check-tool-policy",
  "extensions": {
    "com.example.client": {
      "setting": true
    }
  }
}

7.3.2 Loading and failure isolation

  1. Clients that support portable hooks MUST load portable hook configuration only from hooks.json at the plugin root.
  2. If hooks.json is not valid JSON, targets an Agent Plugins version for which the client has no supported or explicitly recognized compatible version, targets a different Agent Plugins version than plugin.json, or does not satisfy the other top-level requirements in §7.3.1, the client MUST disable the portable hooks component for that plugin and continue loading other component types. The client SHOULD report the invalid, unsupported, or mismatched configuration.
  3. If a member of hooks has an event name not defined by this specification or its value is not a nonempty array, the client MUST skip that member and continue loading other events and component types. The client SHOULD report the invalid member.
  4. If an individual handler does not satisfy the requirements in §7.3.1, including command resolution and containment requirements, the client MUST skip that handler and continue loading other handlers and component types. The client SHOULD report the invalid handler.
  5. If a handler cannot be launched, exceeds a client limit, exits with a nonzero status, or produces invalid output, the invocation fails and produces no portable hook result. The client SHOULD report the failure. Each event definition specifies any further effect of a failed invocation.

7.3.3 Command execution and results

For each occurrence of a hook event, the client MUST invoke every handler for that event that was not skipped under §7.3.2, across all enabled plugins, with the same event input. A client MAY schedule handler invocations sequentially or concurrently, including with bounded concurrency and across overlapping event occurrences. It MUST NOT provide one handler with another handler's result. Handlers MUST NOT depend on invocation order or on side effects from another handler for the same event occurrence.

For each hook invocation, the client MUST launch a fresh handler process with the configured command and args, use the plugin root as its working directory, and provide the subprocess environment defined in §9.1. The client MUST write exactly one UTF-8 JSON object, followed only by optional JSON whitespace, to the handler's standard input and then close standard input. It MUST consume standard output while the handler runs, ensure that standard error cannot prevent the process from completing, and wait for the handler to exit or time out before processing its result. A client MAY impose implementation-defined time and process-output size limits; exceeding a limit is a handler failure.

A handler that exits with status 0 MUST write either of the following to standard output, encoded as UTF-8:

  • no bytes or only JSON whitespace to standard output, expressing no opinion; or
  • optional JSON whitespace, exactly one JSON object satisfying the event's output schema, and optional JSON whitespace.

Any other standard output from a status-0 handler is invalid. In particular, {} is not a no-opinion result. A nonzero exit status is a handler failure, not a portable decision. This specification assigns no portable meaning to any other process output or to the way a client presents hook diagnostics.

Each event definition specifies its input and output schemas and how successful results are combined.

Every event input defined by this version includes these fields:

Field Type Required Description
hook_event_name string Yes Event name defined for the current invocation.
session_id string Yes Opaque identifier for the root agent session.
cwd string Yes Client working directory for the agent when the event occurs.

Each event definition specifies the exact hook_event_name value and any additional fields.

The client defines session boundaries. It MUST use the same session_id for hook invocations it associates with the same root agent session. Handlers MUST otherwise treat session_id as opaque.

cwd MUST be an absolute path. It describes the client working directory for the agent when the event occurs, not the handler process working directory. For PreToolUse and PostToolUse, cwd does not imply that the tool uses that directory as its working directory or that relative paths in the tool's input resolve against it.

In every event-input object whose properties Agent Plugins defines, a client MUST NOT include a property unless it is defined by an Agent Plugins version the client implements. The client MAY include such a property even when the plugin targets an earlier version.

A handler MUST ignore properties it does not recognize in those objects. Both requirements apply recursively.

7.3.4 SessionStart

SessionStart applies when the client establishes a new root agent session. For each such session that reaches a first root-agent model request, the client MUST run the event exactly once after session_id and cwd are established and before submitting that request. The client MAY run the event earlier. For a new session that never reaches a model request, it MAY run the event once or omit it.

Starting another session within the same client process qualifies. Whether a fork, clear, compact, or another operation qualifies depends on whether the client represents its result as a new root agent session with a new session_id. Resuming or reopening an existing session with the same session_id does not qualify. The event does not run for subagent sessions.

The handler receives only the common input fields in §7.3.3. hook_event_name MUST be "SessionStart".

Example input:

{
  "hook_event_name": "SessionStart",
  "session_id": "session-123",
  "cwd": "/workspace"
}

To add context for the session, return:

{
  "additional_context": "Follow the repository's release checklist."
}

additional_context MUST be a nonempty string. The order of returned context values has no portable meaning, and this specification does not prescribe their message role, formatting, persistence, or presentation.

To contribute no additional context, a handler returns no bytes or only JSON whitespace as defined in §7.3.3.

Before submitting the first root-agent model request, the client MUST include the content of every successfully returned additional_context value in the context it provides to its ordinary model-request preparation. Subsequent client context management and model-input limits are client-defined; the client SHOULD preserve the returned context when applying them. Supplying context does not guarantee that the agent follows it.

A failed invocation contributes no context and MUST NOT by itself prevent the session or its first model request from proceeding.

This specification does not define portable session-start results for changing the process environment, initiating a separate agent turn, selecting a model, or changing session metadata.

7.3.5 UserPromptSubmit

UserPromptSubmit MUST run for each newly submitted external user request, including initial and follow-up requests, before the receiving agent processes it. External programmatic submissions qualify regardless of who authored their content. The event applies to requests submitted to a root agent or directly to a subagent where the client mediates submission and controls delivery to the agent. Internally generated delegation, agent reports, and automatic continuations SHOULD NOT trigger the event.

Before allowing the receiving agent to process the request, the client MUST wait for all applicable handlers to complete or fail, including by timeout, and process their results.

hook_event_name MUST be "UserPromptSubmit".

In addition to the common input fields in §7.3.3, the handler receives:

Field Type Required Description
prompt string Yes Client's textual representation of the current request.

prompt MAY be empty, including when the request contains only nontext content. It MUST represent the current submission rather than reuse an earlier request's text. The portable input has no separate attachment field.

Example input:

{
  "hook_event_name": "UserPromptSubmit",
  "session_id": "session-123",
  "cwd": "/workspace",
  "prompt": "Prepare the release."
}

To add context for the agent receiving the request, return:

{
  "additional_context": "Follow the repository's release checklist."
}

To deny the request, return:

{
  "decision": "deny",
  "reason": "Release requests require a target version."
}

To express no opinion, a handler returns no bytes or only JSON whitespace as defined in §7.3.3. A returned JSON object MUST have exactly one of the two shapes above. When present, additional_context and reason MUST be nonempty strings.

If any handler successfully returns deny, the client MUST prevent the entire pending request, including any attachments, from being processed by the agent. It MUST make at least one returned denial reason available to the submitter, whether a user or a programmatic caller. When multiple handlers deny the request, the client MAY select one reason or combine multiple reasons. Denial does not require a model-generated refusal or termination of the session.

A failed invocation contributes no decision or context. The client MAY nevertheless prevent the request from proceeding because a handler failed. Failure handling MUST NOT cause a request denied by a successful handler to proceed.

If the client prevents the request because of a successful deny or a portable handler failure, it MUST NOT automatically deliver that submission or any additional_context returned for that event occurrence to any agent's model input, whether as the current request or as context for another request. The client MAY retain them for display or audit purposes. A deliberate later resubmission, even with identical content, is a new request.

If the request proceeds, the client MUST include the content of every successfully returned additional_context value in the context it provides to the receiving agent's ordinary model-request preparation before that agent processes the request. For a request addressed to a subagent, this is the subagent's context. The order of returned context values has no portable meaning, and this specification does not prescribe their message role, formatting, persistence, or presentation. Subsequent client context management and model-input limits are client-defined; the client SHOULD preserve the returned context when applying them. Supplying context does not guarantee that the agent follows it.

7.3.6 PreToolUse

PreToolUse runs after the client has determined a tool call's name and input, but before it requests any discretionary permission that the hook result could satisfy or begins executing the tool. The event applies to every root-agent or subagent tool call that the client mediates and can intercept at that point. Operations that the client cannot observe and prevent before execution are outside the event's coverage.

hook_event_name MUST be "PreToolUse".

In addition to the common input fields in §7.3.3, the handler receives:

Field Type Required Description
tool_use_id string Yes Opaque identifier for the pending tool call, unique within the session.
tool_name string Yes Client-native tool name in the pending call.
tool_input JSON value Yes Client-native tool input that would be used if the call proceeds unchanged.
tool_profile object No Portable view of the pending call, when the client determines a profile applies.

tool_name and tool_input always retain their client-native forms and are intentionally opaque. Only tool_profile assigns portable meaning to a tool family or input shape; behavior based on tool_name or tool_input is client-specific.

tool_profile is a closed object containing:

Field Type Required Description
name string Yes Portable profile name defined below.
input object Yes Portable projection defined by the selected profile.

Each event has at most one profile. A profile is a partial view of the same pending call: fields omitted from the profile may still affect the native call. A client SHOULD determine whether a pending call matches a profile defined below. When it determines that a profile applies, it MUST include the corresponding tool_profile; otherwise, it MUST omit tool_profile. A client MUST NOT make that determination based only on a client-native tool name or the presence of similarly named input fields.

A handler that does not recognize a tool_profile.name value MUST treat the entire tool_profile as opaque and MUST NOT assign portable meaning to its input. It MAY still inspect tool_name and tool_input as client-specific data.

Example input to the handler:

{
  "hook_event_name": "PreToolUse",
  "session_id": "session-123",
  "cwd": "/workspace",
  "tool_use_id": "tool-456",
  "tool_name": "RunCommand",
  "tool_input": {
    "cmd": "npm test",
    "timeout_ms": 30000
  },
  "tool_profile": {
    "name": "shell",
    "input": {
      "command": "npm test"
    }
  }
}

For an allow decision, return:

{
  "decision": "allow"
}

To deny the tool call, return:

{
  "decision": "deny",
  "reason": "Commands that publish packages are not permitted."
}

The reason MUST be a nonempty string. When a tool call is denied, the client MUST make at least one returned denial reason available to the requesting agent as an explanation of why the call did not execute and MAY also display returned reasons to the user. When multiple handlers deny the call, the client MAY select one reason or combine multiple reasons.

The client MUST combine all successful PreToolUse results as follows:

  1. If any handler returns deny, the tool call is denied.
  2. Otherwise, if any handler returns allow, the client follows any applicable client or organization policy requiring confirmation. If no such policy applies, the client treats discretionary permission for that tool call as satisfied without requesting it separately. An allow does not override other denials or restrictions on execution.
  3. Otherwise, the hooks component expresses no opinion and the client follows its normal permission flow.

The client MUST NOT use allow to override a denial from another hook, an applicable client or organization policy, a sandbox or capability boundary, or user interaction that is intrinsic to the tool's operation.

A failed invocation contributes no decision. The client MAY nevertheless deny the pending tool call because a handler failed. Failure handling MUST NOT cause a tool call denied by a successful handler to proceed.

This specification does not define a portable result for requesting a permission prompt, rewriting tool_input, adding model context, or returning a decision through an exit status.

MCP tool profile

The mcp profile applies to a pending call that the client would send as an MCP tools/call request if it proceeds. For this profile, tool_profile.name MUST be "mcp". tool_profile.input is a deliberately limited projection of the pending request parameters:

Field Type Required Description
name string Yes Tool name that would be sent in the request.
arguments object Yes Tool arguments that would be sent, or an empty object if they would be omitted.

name MUST be identical to the corresponding request value. When the request includes arguments, the profile value MUST be identical; when the request omits arguments, the profile value MUST be an empty object. The client MUST emit PreToolUse after applying any client-side transformation that changes either value. Other MCP request parameters are not represented by this profile.

MCP tool names are scoped to a server; this profile does not identify the server and name alone does not identify a tool across servers. The meaning of properties within arguments remains defined by the MCP tool's advertised inputSchema, not by Agent Plugins.

Example:

{
  "name": "mcp",
  "input": {
    "name": "get_weather",
    "arguments": {
      "location": "Chicago"
    }
  }
}
Shell tool profile

The shell profile applies to a non-MCP tool whose defined operation is to have an operating-system command shell interpret a command string. Operating-system command shells include POSIX-compatible shells, PowerShell, and cmd.exe; the shell may be newly launched or already running. For this profile, tool_profile.name MUST be "shell". tool_profile.input contains exactly one field:

Field Type Required Description
command string Yes Exact command string that the pending call requests to be executed.

command MUST be the complete command source string that the client would cause the shell to interpret for the pending call if it proceeds unchanged. A tool that invokes an executable directly from an argument vector, or merely writes undifferentiated input to an existing process, does not satisfy this profile.

The profile does not identify the shell, execution environment, working directory, or effects of the command, and does not make interpretation of the command string portable across shells.

Example:

{
  "name": "shell",
  "input": {
    "command": "npm test"
  }
}
File read tool profile

The file.read profile applies to a non-MCP tool whose defined operation is to make the contents of exactly one filesystem file available to the agent. For this profile, tool_profile.name MUST be "file.read". tool_profile.input contains exactly one field:

Field Type Required Description
path string Yes Absolute path of the file that the pending call would read.

path MUST be the absolute filesystem path that the client would use if the call proceeds unchanged. The profile does not indicate whether the path is canonical or whether symbolic links have been resolved. The profile applies whether the call would read all or part of the file; it does not identify a range, encoding, content representation, or client-imposed output limit. A call that lists a directory, reads only filesystem metadata, or searches file contents does not satisfy this profile.

A file.read profile identifies the pending call, not every means by which a file can be read. For example, a file read performed through a non-MCP shell tool has the shell profile rather than file.read.

Example:

{
  "name": "file.read",
  "input": {
    "path": "/workspace/src/app.ts"
  }
}
File modification tool profile

The file.modify profile applies to a non-MCP tool whose defined operation is to modify one or more filesystem files when every requested file modification can be represented by an operation kind defined below. It does not apply to directory operations; operations that only change file permissions, ownership, timestamps, or similar attributes; or a general-purpose shell or code-execution tool merely because the call might modify files. For this profile, tool_profile.name MUST be "file.modify". tool_profile.input contains exactly one field:

Field Type Required Description
operations array of objects Yes Nonempty array of requested file modifications.

Each member of operations MUST be exactly one of these closed objects:

Kind Fields Meaning
edit kind, path Derive new file contents from the existing contents at path.
write kind, path Set the complete file contents at path, whether creating or replacing.
delete kind, path Remove the file at path.
move kind, from, to Relocate or rename the file from from to to.

Each kind value MUST equal the kind shown in the table. Every path, from, and to value MUST be the absolute filesystem path that the client would use if the call proceeds unchanged. The profile does not indicate whether paths are canonical or whether symbolic links have been resolved.

The client MUST classify operations from the tool's defined operation and pending input, not from a prediction or observation of filesystem state. In particular, write applies whether or not the destination currently exists. A content change expressed relative to existing contents remains an edit even when it replaces all contents, and writing empty contents remains a write, not a delete. A client MUST represent move only when the defined operation explicitly relocates or renames a file; it MUST NOT infer move from separate write and delete operations.

operations MUST include an entry for each combination of operation kind and associated path or paths requested by the pending call. It MAY contain repeated identical entries. Operations of different kinds remain distinct even when they refer to the same path. When a single requested file modification both edits and moves the same file, the client MUST include corresponding edit and move entries, and edit.path MUST equal move.from. The order and multiplicity of entries have no portable meaning.

The operations are a projection of one pending tool call. A hook decision applies to the pending call as a whole, not to individual entries. The array does not imply that the client will apply the modifications atomically or in any particular physical order. The profile does not standardize file contents, patches, encodings, permissions, or incidental filesystem effects such as creating parent directories. A call that explicitly requests a filesystem modification not represented by one of the kinds above does not satisfy this profile.

A file.modify profile identifies the pending call, not every means by which files can be modified. For example, file modifications performed through a non-MCP shell tool have the shell profile rather than file.modify.

Example:

{
  "name": "file.modify",
  "input": {
    "operations": [
      {
        "kind": "write",
        "path": "/workspace/src/new.ts"
      },
      {
        "kind": "edit",
        "path": "/workspace/src/old.ts"
      },
      {
        "kind": "move",
        "from": "/workspace/src/old.ts",
        "to": "/workspace/src/renamed.ts"
      },
      {
        "kind": "delete",
        "path": "/workspace/src/unused.ts"
      }
    ]
  }
}
Web fetch tool profile

The web.fetch profile applies to a non-MCP tool when its defined operation for the pending call consists only of retrieving content from one absolute HTTP or HTTPS URL and making that content, or a derived representation of it, available to the agent. For this profile, tool_profile.name MUST be "web.fetch". tool_profile.input contains exactly one field:

Field Type Required Description
url string Yes Initial URL target that the client determined for the pending call.

url MUST be an absolute URL with an http or https scheme. It MUST be the initial URL target that the client has determined for the pending call when emitting the event, reflecting any client-side target parsing, normalization, or rewriting already applied at that point. The profile does not indicate whether the URL is canonical.

The profile does not standardize how retrieved content is selected, processed, limited, or represented. It identifies only the initial target, not redirects, embedded resources, or other network destinations contacted while retrieving it. A tool whose defined operation is web search, browser navigation, a general-purpose HTTP request, or downloading content without making it available to the agent does not satisfy this profile.

A web.fetch profile identifies the pending call, not every means by which web content can be retrieved. For example, a fetch performed through a non-MCP shell tool has the shell profile rather than web.fetch.

Example:

{
  "name": "web.fetch",
  "input": {
    "url": "https://example.com/docs"
  }
}
Web search tool profile

The web.search profile applies to a non-MCP tool when its defined operation for the pending call consists only of performing one or more textual searches of the public web and making search results, or a derived representation of them, available to the agent. For this profile, tool_profile.name MUST be "web.search". tool_profile.input contains exactly one field:

Field Type Required Description
queries array of strings Yes Search queries that the client determined for the pending call.

queries MUST contain at least one value. It MUST contain, in order, the textual search queries that the client has determined for the pending call when emitting the event. The array MUST reflect client-side query parsing, normalization, rewriting, or coalescing already applied at that point and MUST preserve any repetitions remaining in the determined list. When the client determines one query, it MUST use a one-element array.

The queries are a projection of one pending tool call. A hook decision applies to the pending call as a whole, not to individual queries. The array does not imply the number or order of searches that the client or provider will perform while executing the call.

The profile does not standardize domain filters, recency, locale, result limits, search depth, provider selection, output limits, or how search results are selected, processed, or represented. It identifies only the queries determined when the event is emitted, not additional or rewritten queries produced while executing the search. A call that requests image search, fetching or navigating to a web page, or any other operation outside textual public-web search does not satisfy this profile.

A web.search profile identifies the pending call, not every means by which the web can be searched. For example, a search performed through a non-MCP shell tool has the shell profile rather than web.search.

Example:

{
  "name": "web.search",
  "input": {
    "queries": [
      "portable hooks for coding agents"
    ]
  }
}

7.3.7 PostToolUse

PostToolUse runs when a tool call produces its completed result for the agent, including a result reporting failure of the requested operation. The event applies to every root-agent or subagent tool call that the client mediates and for which it controls delivery of the result to the agent. A call denied before execution, an intermediate tool exchange, or an invocation that ends without a completed tool result does not reach this event.

Before the agent continues from the associated tool result, the client MUST finish invoking the event's handlers and processing their successful results. This requirement does not impose an order among handlers or require a separate model request for each completed tool call.

hook_event_name MUST be "PostToolUse".

In addition to the common input fields in §7.3.3, the handler receives:

Field Type Required Description
tool_use_id string Yes Opaque identifier for the completed tool call, unique within the session.
tool_name string Yes Client-native tool name in the executed call.
tool_input JSON value Yes Client-native input used for the executed call.
tool_result JSON value Yes Client-native completed tool result.
tool_profile object No Portable view of the completed call and result, when the client determines a profile applies.

The client MUST use the same tool_use_id for PreToolUse and PostToolUse events that refer to the same call. The name and input in PostToolUse MUST describe the call actually dispatched; they need not equal an earlier PreToolUse event's values if the call was subsequently amended.

tool_name, tool_input, and tool_result retain their client-native forms and are intentionally opaque. Only tool_profile assigns portable meaning to them; behavior based on native fields is client-specific.

tool_profile is a closed object containing:

Field Type Required Description
name string Yes Portable profile name defined below.
input object Yes Portable input projection of the executed call.
result object Yes Portable result projection defined by the selected profile.

Each event has at most one profile. An emitted profile MUST use the operation criteria and input projection in §7.3.6 for the executed call, with the result shape defined below. A profile is a partial view of that call and its result. A client SHOULD determine whether the completed call and result match a profile defined below. When it determines that a profile applies, it MUST include the corresponding tool_profile; otherwise, it MUST omit tool_profile. A client MUST NOT make that determination based only on a client-native tool name or the presence of similarly named fields.

A handler that does not recognize a tool_profile.name value MUST treat the entire tool_profile as opaque and MUST NOT assign portable meaning to its input or result. It MAY still inspect the native fields as client-specific data. A handler that does not recognize a content object's type in a file.read or web.fetch result MUST treat that content object as opaque.

Example input, using an illustrative client-native tool:

{
  "hook_event_name": "PostToolUse",
  "session_id": "session-123",
  "cwd": "/workspace",
  "tool_use_id": "tool-456",
  "tool_name": "RunCommand",
  "tool_input": {
    "cmd": "npm test"
  },
  "tool_result": "All tests passed.",
  "tool_profile": {
    "name": "shell",
    "input": {
      "command": "npm test"
    },
    "result": {
      "output": "All tests passed.",
      "exit_code": 0
    }
  }
}

To add context for the agent receiving the tool result, return:

{
  "additional_context": "The unit tests passed. Run the integration tests before finishing."
}

additional_context MUST be a nonempty string. The order of returned context values has no portable meaning, and this specification does not prescribe their message role, formatting, persistence, or presentation. To contribute no additional context, a handler returns no bytes or only JSON whitespace as defined in §7.3.3.

Before continuing the agent from the associated tool result, the client MUST include the content of every successfully returned additional_context value in the context it provides to that agent's ordinary model-request preparation. For a subagent tool call, this is the subagent's context. Subsequent client context management and model-input limits are client-defined; the client SHOULD preserve the returned context when applying them. Supplying context does not guarantee that the agent follows it.

A failed invocation contributes no context and MUST NOT by itself prevent the agent from continuing. This specification does not define portable PostToolUse results for replacing the tool result, retrying the call, or requesting a separate agent turn.

MCP result

For the mcp profile, result MUST be the completed MCP CallToolResult object, without its JSON-RPC response envelope. Its fields and content types retain their MCP-defined meanings, including content, structuredContent, and isError when present. A result with isError: true is a completed tool result and reaches this event. Intermediate MCP exchanges do not reach this event.

The properties inside this result are defined by MCP, not Agent Plugins. MCP protocol and transport failures are not represented by this profile.

Shell result

For the shell profile, result is a closed object with these required fields:

Field Type Description
output string Captured command output returned to the agent.
exit_code integer Exit code reported for the completed command.

output contains the returned standard output and standard error as one string. A client that captures them separately MUST combine their returned contents; this specification does not prescribe how the two streams are interleaved. An empty string means the returned output is empty, not unavailable.

A completed command with a nonzero exit code uses this same result representation, not an error alternative. If the exit code is unavailable, the client MUST omit the entire tool_profile.

File read result

For the file.read profile, a successful result is a closed object with one required field:

Field Type Description
content array of objects File content returned to the agent, in its returned order.

Each content object MUST be one of these closed objects:

type Other required fields Meaning
text text: string Returned text.
binary media_type: nonempty string; data: string Returned bytes, with data encoded as base64 and media_type identifying their media type.

The content is the representation returned to the agent, which may be partial, truncated, or transformed. It need not contain the entire file. For binary content, media_type MUST describe the returned bytes, not a different source representation.

Example result:

{
  "content": [
    {
      "type": "text",
      "text": "# Project notes\n"
    }
  ]
}

For a failure of the requested read operation, such as a missing file, result MUST instead be a closed object containing only error, a string carrying the returned failure diagnostic. This alternative MUST NOT represent failures of the client implementation or transport.

{
  "error": "File not found: /workspace/notes.md"
}
File modification result

For the file.modify profile, a successful result MUST be an empty object:

{}

For a failure of the requested modification operation, such as an edit whose target text does not match, result MUST instead be a closed object containing only error, a string carrying the returned failure diagnostic. This alternative MUST NOT represent failures of the client implementation or transport.

The result describes the call as a whole. It does not report individual operation outcomes, and an error does not imply that no modifications occurred or that earlier modifications were rolled back.

Web fetch result

For the web.fetch profile, result is a closed object with these required fields:

Field Type Description
status_code integer HTTP response status code, from 100 through 599.
content array of objects Returned content or diagnostic text, in its returned order.

Each content object MUST be a closed object with type equal to "text" and a required text string. status_code MUST identify the response whose content or diagnostic is represented, rather than an intermediate redirect response. If the HTTP response status is unavailable, the client MUST omit the entire tool_profile.

The content is the representation returned to the agent, which may be selected, processed, or limited. A diagnostic returned for an HTTP response uses the same text representation as fetched page content. This specification does not classify HTTP status codes as tool success or failure.

Example result:

{
  "status_code": 404,
  "content": [
    {
      "type": "text",
      "text": "The requested page was not found."
    }
  ]
}
Web search result

For the web.search profile, a successful result is a closed object with one required field:

Field Type Description
items array of objects Sources returned by the search tool.

Each item is a closed object containing:

Field Type Required Description
url string Yes URL returned for the source.
title string Yes Title returned for the source.
snippet string No Text associated with this source that the tool included in the result made available to the model.

url MUST be nonempty. A client MUST NOT synthesize a snippet when the tool did not return such source-associated text. items MUST include every source entry returned by the tool and made available to the model. A successful search returning no sources MUST use an empty items array.

For a failure of the requested search operation, such as an invalid query, result MUST instead be a closed object containing only error, a string carrying the returned failure diagnostic. This alternative MUST NOT represent failures of the client implementation or transport.

A call that returns partial search results uses the items representation; it does not also include errors from individual subrequests.

Example result:

{
  "items": [
    {
      "url": "https://example.com/docs",
      "title": "Example documentation",
      "snippet": "Instructions for configuring the project."
    }
  ]
}

7.3.8 Stop

Stop runs when the root agent has completed a response normally, has no immediate model or tool follow-up, and would otherwise stop its foreground agent loop and yield control. It does not run for subagents. It does not run while the root agent is paused within a response for a permission decision or tool result. It does not run solely because execution ends through cancellation, interruption, or an unsuccessful model, API, or internal operation. The event applies only in an execution mode and at a kind of response boundary for which the client implements the continuation result below.

The event depends on the agent-loop boundary, not on the response's representation or content. A normal response may be textual, structured, or empty, and may ask the user a question in its content. A client-mediated interaction that pauses an unfinished response to collect user input, including through a user-elicitation tool, does not reach this event. A response produced after a hook continuation reaches the event again if it satisfies the boundary above.

The response has already been produced when the event runs. The client MAY already have streamed, displayed, or persisted it, and a hook result does not retract or replace it. The event does not indicate that the session, subagents, background processes, or scheduled work are complete. Such work may remain active or initiate later agent work.

hook_event_name MUST be "Stop".

In addition to the common input fields in §7.3.3, the handler receives:

Field Type Required Description
continuation_active boolean Yes Whether the current root-agent work is fulfilling an after-response continuation.

continuation_active MUST be true if the current root-agent work is fulfilling an honored request from an earlier hook at this or a corresponding client-specific after-response boundary, directly or through consecutive after-response hook continuations; otherwise, it MUST be false. An intervening yield does not change the value when the client later resumes the requested continuation. A new user request, unrelated background work, or later work merely spawned during a continuation does not inherit the value. The value reflects continuation by the aggregate after-response hook mechanism and does not identify a handler or provide a continuation count.

Example input:

{
  "hook_event_name": "Stop",
  "session_id": "session-123",
  "cwd": "/workspace",
  "continuation_active": false
}

To request further agent work, return:

{
  "decision": "continue",
  "reason": "Run the test suite before finishing."
}

The reason MUST be a nonempty string. It is an instruction or explanation for continued work, not a portable user submission. The order of reasons has no portable meaning, and this specification does not prescribe their message role, formatting, persistence, or presentation.

If any handler returns continue, the portable hooks component requests one continuation of the root agent using all successfully returned reasons. Otherwise, the portable hooks component expresses no opinion. A failed invocation contributes no decision and MUST NOT by itself cause continuation.

When the portable hooks component requests continuation, the client MUST attempt another immediate root-agent continuation before treating the foreground execution as complete, unless cancellation, newer explicit user control, applicable policy, a client-specific hook result, or a client-enforced resource, time, turn, cost, or continuation limit prevents it. When the continuation is honored, the client MUST include the content of every successfully returned reason in the continuation context it submits to its ordinary agent-loop processing. Subsequent client context management and model-input limits are client-defined; the client SHOULD preserve the reasons when applying them. If a boundary prevents the continuation, the client SHOULD report that it was not honored. A continuation does not retract the completed response or guarantee that the agent follows a returned reason. A client MAY impose a positive finite limit on consecutive hook-requested continuations.

If background work or another independent stimulus arrives while handlers run or continuation begins, the client defines how it orders or combines that work.

8. Client extensions

Client-specific additions to the JSON objects defined by this specification MUST be represented under a reverse-domain namespace in an extensions field. Client-specific files MUST be represented under a top-level directory named for that namespace. A client MAY use either representation or both.

The top-level assets/ directory is reserved for portable assets under §4.3 and MUST NOT be used as an extension directory.

A client SHOULD base its namespace on a domain name it controls and SHOULD keep the namespace stable. For example, a client that controls example.com could use com.example.client.

Agent Plugins assigns no portable discovery, validation, loading, or failure semantics within a client extension namespace. Each client defines the contents and behavior of its own namespace, including how its configuration data and files relate.

8.1 Extension data

An extensions field MUST be an object whose member names are client extension namespaces and whose member values are objects.

Example:

{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/plugin.schema.json",
  "name": "example-plugin",
  "extensions": {
    "com.example.client": {
      "setting": true
    }
  }
}

A client MUST ignore members of extensions for namespaces it does not implement, without validating the contents of their object values. Validation and failure handling within an implemented namespace are defined by that client.

8.2 Extension directories

The extension directory for a namespace is the top-level directory named after it. For example, files for com.example.client belong in com.example.client/.

Example: a file-only client extension

my-plugin/
├── plugin.json
├── skills/
│   └── summarize/
│       └── SKILL.md
└── com.example.client/
    └── hooks/
        └── hooks.json

A client that implements file-based behavior for a namespace MUST look for it in the corresponding top-level directory.

9. Environment variables and placeholder expansion

See also: §7.2 MCP servers and §7.3 Hooks for subprocess configuration rules, and §4.1 General requirements for path safety rules.

9.1 Subprocess environment

Clients that launch plugin subprocesses, including stdio MCP servers and hook handlers, MUST provide PLUGIN_ROOT and PLUGIN_DATA in each subprocess environment. PLUGIN_ROOT is the absolute path to the filesystem-resolved plugin root. PLUGIN_DATA is the absolute path to a client-managed persistent data directory dedicated to that installed plugin instance.

The client chooses the PLUGIN_DATA location. It MUST create the directory before launching a plugin subprocess, MUST make it writable to that subprocess, and MUST preserve its contents across plugin updates. The client MAY delete the directory when the plugin is uninstalled.

Use PLUGIN_DATA for: installed dependencies (node_modules, virtual environments), generated code, caches, and other plugin state that should persist across updates. Use PLUGIN_ROOT for referencing bundled scripts, binaries, and config files that ship with the plugin.

The client chooses the base subprocess environment and MAY inherit, omit, or sanitize ambient variables. For a stdio MCP server, after placeholder expansion, entries in the server's env object MUST overlay the base environment and replace same-name entries according to platform environment-name semantics. For every plugin subprocess, the client MUST then set PLUGIN_ROOT and PLUGIN_DATA to the values defined above, replacing any entries with equivalent names according to platform environment-name semantics.

Except for the platform executable search used to resolve a bare command, plugins claiming conformance MUST NOT depend on a base-environment variable unless this specification requires that variable or the applicable subprocess configuration supplies it explicitly.

Working-directory rules are defined separately from these environment variables. A stdio MCP server whose configuration omits cwd uses the plugin root as its working directory, as does every hook handler. The cwd field in hook event input instead identifies the agent's working directory.

Example: a client loads the plugin devtools from /home/alex/.agents/plugins/devtools and assigns it the data directory /home/alex/.agents/plugins/data/devtools while the agent is working in /workspace/app. The relevant paths are:

Item Value
PLUGIN_ROOT /home/alex/.agents/plugins/devtools
PLUGIN_DATA /home/alex/.agents/plugins/data/devtools
Stdio MCP server working directory (cwd omitted) /home/alex/.agents/plugins/devtools
Hook handler working directory /home/alex/.agents/plugins/devtools
Hook event-input cwd /workspace/app

9.2 Placeholder expansion

Clients that launch stdio MCP servers or hook handlers MUST expand ${PLUGIN_ROOT} and ${PLUGIN_DATA} in the supported configuration fields for those subprocesses. Expansion is a single, non-recursive textual replacement of every exact occurrence of either placeholder. Text introduced by a replacement MUST NOT be scanned for further placeholders.

For a stdio MCP server, expansion applies to every string element of args, every string value in env, and the cwd string. For a hook handler, expansion applies to every string element of args. It does not apply to command, env keys, or fixed component locations.

Unrecognized placeholder-like text MUST remain literal. Clients MUST NOT perform any other placeholder or environment-variable expansion.

Configured env values are visible package data, not a portable secret mechanism. Plugins MUST NOT embed credentials or other secrets in env.

An MCP server's env object MUST NOT contain entries named PLUGIN_ROOT or PLUGIN_DATA. Such an entry makes that server configuration invalid under §7.2.2. Clients MUST supply the reserved environment variables themselves.

Example: plugin variable expansion in MCP

{
  "$schema": "https://agent-plugins.org/schemas/1.1.0/mcp.schema.json",
  "mcpServers": {
    "database": {
      "type": "stdio",
      "command": "npx",
      "args": ["--config", "${PLUGIN_ROOT}/config/db.json"],
      "cwd": "${PLUGIN_ROOT}",
      "env": {
        "DATA_DIR": "${PLUGIN_DATA}/database"
      }
    }
  }
}

10. Versioning

10.1 Specification and schema versions

The version in §1 identifies the complete Agent Plugins specification release, including its normative text and every schema it defines. Every release MUST publish each of its schemas with the same version as the specification, even when a schema's validation rules are unchanged from the previous release. This specification defines the plugin manifest, MCP configuration, and hooks configuration schemas.

A plugin's required plugin.json $schema value declares the Agent Plugins version that the package targets. When mcp.json or hooks.json is present, the version in that file's $schema value MUST match the version declared by plugin.json. A mismatch makes that component's configuration invalid under §7.2.2 or §7.3.2 but does not invalidate other component types.

A change to any schema requires a new specification release. Published canonical schema identifiers MUST NOT be reassigned to different schema contents. Existing plugins MAY continue targeting an older Agent Plugins version; clients determine support using the declared canonical identifiers and any explicit compatibility mappings.

10.2 Plugin versions

Plugins SHOULD use Semantic Versioning for version.

Segment Meaning Description
Major Breaking change Incompatible behavior or schema change.
Minor Backward-compatible feature New behavior without breaking existing clients or users.
Patch Backward-compatible fix Corrective change without intended behavioral break.

Clients MAY use version to determine whether updates are available and whether caches are stale.

11. Client conformance

11.1 Minimum client requirements

A conformant client MUST satisfy all applicable requirements in sections 1–10. At minimum, it:

  1. Can load a plugin from a directory path.
  2. Selects a locally supported plugin manifest schema from $schema, then parses and validates the closed plugin.json schema using the non-fatal unknown-field exception in §5.2.
  3. Ignores unimplemented members of extensions without validating the contents of their object values.
  4. For each component type it supports, discovers components in its fixed location.
  5. If it supports MCP servers, selects a locally supported MCP configuration schema from $schema and supports at least one of the stdio or streamable-http variants in mcp.json.
  6. If it supports hooks, selects a locally supported hooks configuration schema from $schema and implements SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, and Stop as defined in §7.3.
  7. If it launches plugin subprocesses, provides PLUGIN_ROOT and PLUGIN_DATA in their environments.
  8. If it launches stdio MCP servers, expands both plugin variables in the supported MCP configuration fields, resolves command as a single executable token, and uses the plugin root as the default subprocess working directory.
  9. If it launches hook handlers, expands both plugin variables in args, resolves command as a single executable token, and uses the plugin root as the subprocess working directory.
  10. Supports at least one component type (skills, MCP servers, or hooks).

11.2 Incremental adoption

A client is not required to support every component type. For example, a skills-only client can conform without supporting MCP servers or hooks, provided it satisfies all applicable requirements.

11.3 Unsupported components and failures

  1. Clients MUST ignore unsupported component types.
  2. An unknown top-level field is non-fatal under §5.2. Any other plugin.json schema violation is fatal to the plugin: the client MUST reject the plugin and MUST NOT discover or execute any of its components.
  3. A failure isolated to a component type, component entry, or component process MUST NOT prevent the client from loading independently valid components. Clients MUST apply the failure behavior defined for that component in §6 and §7.
  4. Clients SHOULD report invalid configuration and component failures. Clients MAY report partially unsupported plugins, but lack of support for a component type, MCP transport, or client extension is not itself an error.

Appendix A: Conformance Checklist

This checklist is for convenience only — when it conflicts with the spec text above, the spec governs.

Plugin loader

  • Parse and validate plugin.json (§5.1, §5.2)
  • Validate required $schema and name fields (§5.3)
  • Validate plugin name against naming constraints (§5.5)
  • If presenting a human-readable plugin name, prefer displayName and fall back to name (§5.4)
  • Report and ignore unknown plugin.json fields (§5.2)
  • Ignore unimplemented namespaces in manifest extensions without validating the contents of their object values (§8.1)
  • Reject package paths that resolve outside the plugin root (§4.1)
  • If displaying plugin icons, discover icon candidates, support PNG, and isolate unusable candidates from plugin and component loading (§4.3.1)
  • If rendering SVG icons, prevent active content and external resource loading (§4.3.1)
  • Discover implemented file-based extensions from their top-level namespace directories (§8.2)

Component discovery

  • Scan the fixed location for each supported component type (§6.1)
  • Ignore missing fixed locations without error (§6.2)

MCP configuration

  • Select a supported $schema, then validate the closed mcp.json schema and each server variant (§7.2.1)
  • Ignore unimplemented namespaces in server extensions without validating the contents of their object values (§8.1)
  • Skip a server with a non-object extensions field without affecting other servers or components (§7.2.2, §8.1)
  • If supporting MCP, implement at least one of stdio or Streamable HTTP (§7.2.1)
  • Use each server entry's declared transport for the initial connection attempt (§7.2.1)
  • Enforce remote URL and literal-header requirements (§7.2.1)

Hooks configuration

  • Select a supported $schema, then validate the outer hooks configuration, each event member, and each handler against the closed schema, applying §7.3.2's failure boundaries (§7.3.1)
  • Disable only the portable hooks component for invalid outer configuration; skip invalid event members and handlers independently (§7.3.2)
  • Ignore unimplemented namespaces in handler extensions without validating the contents of their object values (§8.1)
  • Skip only the affected handler if its extensions field or a namespace value is not an object (§7.3.1, §7.3.2)
  • Preserve portable hook requirements when applying client-specific handler settings (§7.3.1)
  • Run SessionStart exactly once before the first root-agent model request in each new root agent session, treating any operation that creates a new root agent session with a new session_id as qualifying and excluding resume of an existing session_id and subagent sessions (§7.3.4)
  • Include every successful SessionStart additional_context value in the context prepared for the first root-agent model request (§7.3.4)
  • Run UserPromptSubmit before processing each external user request, including programmatic submissions and requests directly addressed to subagents at boundaries the client controls, with the current request's textual representation (§7.3.5)
  • Wait for every UserPromptSubmit handler to complete or fail before allowing the receiving agent to process the request; if it proceeds, include every successful additional_context value in that agent's prepared context (§7.3.5)
  • Prevent the entire request if any UserPromptSubmit handler successfully returns deny, and make at least one returned denial reason available to the submitter (§7.3.5)
  • Exclude a request prevented by a portable UserPromptSubmit denial or handler failure, and all context returned for that occurrence, from automatic delivery to model input now or later (§7.3.5)
  • Run PreToolUse for every interceptable root-agent and subagent tool call after the tool name and input are known and before discretionary permission or tool execution (§7.3.6)
  • When a pending call is determined to match the mcp, shell, file.read, file.modify, web.fetch, or web.search profile, add the corresponding tool_profile while preserving the client-native tool name and input; otherwise, omit tool_profile (§7.3.6)
  • Run PostToolUse for completed root-agent and subagent tool results at boundaries the client controls, preserving the call identifier, executed input, and native result (§7.3.7)
  • When a completed call and result are determined to match a defined profile, include its portable input and result projections; otherwise, omit tool_profile (§7.3.7)
  • Wait for PostToolUse handlers and include every successful additional_context value in the receiving agent's prepared context before it continues from the tool result (§7.3.7)
  • Run Stop when the root agent completes a response normally and would otherwise yield control, without treating it as a pre-publication or quiescence event (§7.3.8)
  • Set continuation_active while root-agent work fulfills an honored request from the aggregate after-response hook mechanism, then combine successful continue results into one continuation that includes every returned reason in its prepared context (§7.3.8)
  • Launch a fresh handler process in the plugin root for each invocation (§7.3.3)
  • Send the same defined event object to every enabled handler, close standard input, and parse only the defined status-0 standard output as a portable result (§7.3.3)
  • Include only properties defined by an implemented Agent Plugins version in event-input objects whose properties Agent Plugins defines (§7.3.3)
  • Ignore unrecognized properties recursively in event-input objects whose properties Agent Plugins defines (§7.3.3)
  • Treat a tool_profile with an unrecognized name as opaque without assigning portable meaning to its input or result (§7.3.6, §7.3.7)
  • Treat an unrecognized content type in a file.read or web.fetch result as opaque (§7.3.7)
  • Combine multiple decisions so that deny takes precedence over allow, and allow takes precedence over no opinion (§7.3.6)
  • Apply allow only to discretionary permission, without overriding other hooks or client-enforced boundaries (§7.3.6)
  • Treat an invocation failure as no portable result, then apply the event-specific failure rules (§7.3.2, §7.3.4, §7.3.5, §7.3.6, §7.3.7, §7.3.8)

Environment and expansion

  • If the client launches plugin subprocesses, provide PLUGIN_ROOT and a dedicated writable PLUGIN_DATA directory (§9.1)
  • Resolve MCP server command as a single bare or plugin-relative executable token (§7.2.1)
  • Resolve hook handler command as a single bare or plugin-relative executable token (§7.3.1)
  • Use the plugin root as the default MCP server working directory (§7.2.1)
  • Validate explicit cwd forms and post-resolution containment (§7.2.1)
  • For stdio MCP servers, overlay configured env entries on a client-selected base environment (§9.1)
  • Set client-provided PLUGIN_ROOT and PLUGIN_DATA after applying configured env, replacing equivalent names according to platform environment-name semantics (§9.1)
  • Do not require configured PATH to affect bare-command resolution (§7.2.1)
  • Expand only ${PLUGIN_ROOT} and ${PLUGIN_DATA} in MCP server args, env, and cwd fields and hook handler args (§9.2)

Resilience

  • Ignore unsupported component types (§11.3)
  • Skip server entries whose declared transport is unsupported without affecting other servers or components (§7.2.2)
  • Continue loading when an independent component fails (§11.3)
  • Support at least one component type (§11.1)

Design Decisions

This section explains why key design choices were made. It is for context only — the binding rules are in the normative sections above.

Why directory-based discovery?

Plugins use filesystem directories as the package unit rather than archive formats (.zip, .tar.gz) or registry-fetched bundles. This keeps plugins inspectable with standard tools (ls, cat, git), editable in-place during development, and compatible with version control without special tooling. Fixed root-level locations such as skills/, mcp.json, and hooks.json eliminate discovery indirection, alternate-source precedence, and manifest configuration that every client would otherwise need to implement.

Why these component types?

Skills and MCP have established specifications outside this project and meaningful cross-client adoption. Hooks have demonstrated enough cross-client convergence for a narrow portable contract. Other proposed component types — such as commands, agents, rules, and LSP servers — remain outside the portable format until a stable cross-client contract is demonstrated.

Why fixed icon filenames?

A generic plugin icon can be discovered from a fixed package location without a manifest field or configurable path. Conventional files under assets/ keep packages directly inspectable, let clients and registries find icons with the same rules, and leave format selection to each icon-rendering client. Reserving assets/ also provides one collision-free location for future portable asset conventions.

Why root-level plugin.json is the conformance floor

Every conformant client MUST check plugin.json at the plugin root (§5.1). This gives plugin authors a single guaranteed manifest that works across all clients without client-specific path knowledge.

Why a closed portable manifest?

Restricting root plugin.json to known fields enables strict validation, typo detection, and schema-driven key completion. Client experiments cannot claim arbitrary top-level fields; they are contained under reverse-domain keys in extensions. Unknown top-level fields remain schema violations, but clients report and ignore them instead of rejecting an otherwise valid plugin.

Why separate name and displayName?

The constrained name field gives every client the same portable plugin name. The optional displayName field lets authors present capitalization, spacing, punctuation, and branding that do not fit those constraints. Keeping the roles separate prevents presentation changes from changing the portable name.

displayName is intentionally constrained only by its JSON type. Presentation needs such as length and formatting vary across clients and UI surfaces, and the field affects only optional presentation metadata. Clients can fall back to the required name when displayName is unsuitable for a presentation context, rather than reject an otherwise valid plugin.

Why reverse-domain client extensions?

Reverse-domain identifiers provide a decentralized convention for avoiding collisions without requiring a central client-name registry. The same identifier can be used for configuration data and a client-specific directory; each representation can exist independently. Extension directories remain top-level to keep plugin layouts flat and convention-driven.

Why extensions on individual MCP servers?

An MCP server's extensions field keeps client-specific settings alongside its portable configuration. Authors can configure a server in one place without repeating its name in a separate client-specific mapping.

Why an explicit MCP configuration format?

Existing clients use incompatible MCP configuration shapes and infer transports differently. Agent Plugins therefore defines an explicit closed union whose meaning is independent of any client-native format. Distinguishing Streamable HTTP from legacy HTTP+SSE gives each entry an unambiguous initial transport while leaving fallback behavior after a failed connection outside the portable format.

Why may clients support only one standard MCP transport?

Stdio and Streamable HTTP serve different deployment and security models. Requiring every MCP-capable client to support both local process execution and remote HTTP connectivity would expand its implementation and trust surface without changing the portable configuration format. Because each server entry declares its transport, a client can skip unsupported entries while continuing to load independent servers and components.

Why do schemas share the specification version?

plugin.json, mcp.json, and hooks.json schemas use the Agent Plugins specification version rather than independent version sequences. This gives plugin authors and clients one portable format version to understand, prevents mixed-version packages, and lets $schema select the complete validation and interpretation contract — including requirements that JSON Schema cannot express. Republishing an unchanged schema with a new specification release is a small maintenance cost compared with exposing independent compatibility timelines.

Why separate command and args?

MCP servers and hook handlers represent subprocess launch configuration as one executable token and a separate argument array. This preserves argument boundaries and avoids assigning portable meaning to shell syntax whose parsing, quoting, expansion, and built-ins differ across platforms. The model defines portable invocation data, not a universal executable format. Platform APIs or required interpreters may encode that data differently, and some executable forms or argument values may not be launchable on every platform; such cases are invocation failures under the applicable component rules.

Why plugin variables over relative paths in configs?

MCP server and hook handler arguments may need absolute paths at runtime. ${PLUGIN_ROOT} provides an unambiguous, client-resolved anchor for bundled files, while ${PLUGIN_DATA} identifies client-managed writable state that persists when package contents are replaced during an update. The command field does not use interpolation: a ./ path is resolved directly against the plugin root, and a bare name uses the platform's executable search rules. Clients differ in inherited environment and PATH behavior, so Agent Plugins standardizes configured environment overrides but leaves bare-command search client-defined; plugin-relative commands provide deterministic resolution of bundled commands.

Why component failures are non-fatal

When an MCP server fails to start or connect, or a hook handler fails, the client continues loading the plugin's remaining components (§11.3). A plugin with multiple components should not become entirely unusable because one process is unavailable. Whether a pending tool call or submitted request proceeds after a hook failure remains client-defined because clients have materially different native safety policies.

Why does each hook invocation use a fresh process?

Portable hook handlers are commands because process-based command hooks already converge across major clients and let plugins use any implementation the client can execute without requiring a shared in-process runtime or callback API. A fresh process also gives each invocation a simple boundary and isolates process-local state and failures. Reusing a process would require additional rules for message framing, request correlation, concurrency, cancellation, and worker lifecycle.

Why extensions on individual hook handlers?

A handler's extensions field keeps client-specific settings alongside its portable configuration. Authors can configure each handler in one place without introducing handler identifiers or a separate client-specific mapping.

Why use familiar lifecycle hook names?

SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, and Stop reuse names already familiar to plugin authors and client implementers from analogous hooks in major clients. Their definitions specify the portable event boundaries and results; shared names do not imply equivalence with any client’s native hooks.

Why is SessionStart limited to new sessions and additional context?

Clients broadly support adding context before the first model request of a new root agent session, but they do not share client-native source categories for resume, clear, compact, and related operations. The portable event instead follows session identity: an operation qualifies when the client represents its result as a new root agent session with a new session_id. This lets handlers initialize state keyed by that identifier, while later activation of an existing session remains outside the event.

The event may run eagerly or when the first request is prepared because clients initialize sessions at different times. Requiring its context before that request preserves the observable interoperability point without requiring eager session-object hooks. Other native results—such as environment changes, automatically initiated agent turns, model selection, and session metadata—do not have comparable support or semantics across clients.

Why discard additional context when a request is rejected?

Retaining hook context after rejection can cause a later, unrelated request to inherit instructions intended for the rejected request. The context may also repeat portions of the rejected prompt, exposing them to the model despite the rejection. These effects can occur even when the context comes from a successful handler and a different handler rejects the request.

Why is Stop a response boundary?

Clients converge on a hook after the root agent has produced a candidate stopping response, but they do not share a stronger notion of task or turn completion. The response may already be visible or persisted, background work may remain, and a hook continuation may append work within the same native turn or start another.

The initial event omits response text, transcript paths, native statuses, background-task details, and native turn identifiers because clients do not expose them consistently or assign them common timing and identity semantics. The session identifier and global continuation Boolean provide the common state needed for continuation and loop prevention without requiring clients to reconstruct response content, parse client-native transcripts, inventory background work, or synthesize turn identities. Making the Boolean global and source-agnostic lets clients project their existing stop-hook flag or counter without tracking which handler caused an earlier continuation; when a client preserves that native causal state across an asynchronous hook wake, the portable value preserves it too.

Why preserve native tool data and add portable profiles?

Clients do not share built-in tool names, argument schemas, or result schemas. Preserving the native JSON lets client-aware hooks inspect the actual call without pretending that unlike tools have a common data model. A separate portable projection captures a tool family and useful common structure where clients can map it deterministically, without making client-native names part of a registry that future versions could collide with or discarding native fields outside the portable minimum. The tool_profile object keeps the profile name and its input and, for PostToolUse, result projections together, so they are present or absent as a unit. Its closed, versioned field namespace remains separate from the opaque native data. Client-specific fields stay in tool_input and tool_result rather than sharing the portable namespace, where they could obscure portable guarantees or collide with fields added by later Agent Plugins versions.

Clients are encouraged rather than required to recognize every applicable profile, but an emitted profile is a reliable conformance claim. The hooks configuration does not include tool-name matchers because a handler can inspect the same event input itself, avoiding a second matching language and client-specific naming assumptions.

Why does the file.read input expose only a path?

Clients express partial file reads differently: some use a starting line and count, some use inclusive endpoints, and some expose no requested range. Some tools also select PDF pages or use byte offsets for binary files. Path-based access policy does not require normalizing those models. Restricting the input projection to the absolute path provides the useful common field without introducing range concepts that clients cannot map consistently.

Why does file.modify use an operations array?

Clients expose both single-purpose file tools and compound patch tools. A single file.modify profile lets either form map one native call to one hook event: a single-purpose call produces one operation, while a compound call can describe edits, writes, deletions, and moves together. Keeping the operation kind inside the profile avoids splitting one pending call into independently decided events or omitting mixed calls. The profile exposes paths and operation kinds because those support useful access policy across clients; native content and patch representations remain too different to standardize.

Why does the web.fetch input expose only one URL?

A single initial URL supports access policy without requiring a portable model for batching or correlating multiple targets with retrieved content. Other inputs do not have comparably portable semantics: prompts and queries process or select content in different ways, while representation, pagination, output-limit, and timeout controls appear only in some clients. Exposing only the initial URL avoids implying common retrieval or content-processing behavior.

Why does the web.search input expose only queries?

Clients identify search requests as either one textual query or a batch, so a nonempty array represents both forms without splitting one native call into multiple hook events. Domain filters, recency, locale, result limits, search depth, provider selection, and output limits differ across clients or operate at different layers. Query text is the useful common input that clients can project without implying common search behavior.

Search and fetch remain separate profiles because clients generally expose them as distinct operations. A pending call that combines them or requests another operation receives neither profile: assigning one profile would omit part of the call governed by the hook decision.

Why are hook decisions structured results?

Client-native exit-status conventions may express different effects at different events. Portable hooks therefore treat a nonzero status as handler failure and accept portable control only from a status-0 structured result. For example, deny prevents a pending tool call, and continue requests further root-agent work.

Why are event inputs closed for clients but open for handlers?

Closed producer schemas prevent clients from adding nonstandard properties that could conflict with future portable fields and let clients validate the exact inputs they emit for a specification version. Requiring handlers to ignore unrecognized properties lets later Agent Plugins versions add input fields without making clients filter events according to each plugin's targeted version.

The asymmetric rule applies only to event inputs. Configuration and handler results remain closed because an unrecognized plugin-authored property may be a typo or carry behavior that a client cannot safely ignore.