agents/ability-call should only dispatch abilities that opt into an external surface

Open
#587 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
api, security

Research direction

Start by locating the agents/ability-call and agents/ability-search implementations and the agents_ability_call_permission filter. Trace how registered ability metadata is read and how dispatchability is decided, then check the related tests. Done means calls and search results follow the external-surface rule by default, hosts can override it with a filter, and the permission callback receives the target name and metadata.

Written by the indexing model from the issue text.

Description

Summary

agents/ability-call executes any registered ability by name and checks only the target ability's permission_callback. It ignores the target's exposure metadata (show_in_rest, mcp.public).

Many plugins register in-process primitives with show_in_rest: false and a permissive permission callback. They expect only trusted server-side PHP to call them, and in the ecosystem "not REST-exposed" is commonly treated as "internal". When a host widens agents_ability_call_permission for non-administrators, which is the documented extension point, every such primitive becomes callable by those users. agents/ability-call is itself show_in_rest: true, so that includes calls through core /wp-abilities/v1.

Proposal

  • By default, agents/ability-call (and agents/ability-search results) only dispatch abilities that opt into an external surface: meta.show_in_rest === true or meta.mcp.public === true. This matches the WordPress MCP adapter convention.
  • Add a filter, e.g. agents_ability_call_dispatchable, for hosts that need a different rule.
  • Pass the target ability name and meta into agents_ability_call_permission, so hosts can make per-target decisions without re-reading the registry.

Context

The Extra Chill MCP worked around this at the host layer (Extra-Chill/extrachill-mcp#24). The fix belongs in the substrate so every host gets a safe default.

🤖 AI-generated (Extra Chill Bot / Pi).

Dominant language
PHP
Stars
36
Forks
10
Avg merge
14m
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/agents-api

All issues in Automattic/agents-api

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.