Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include = ["/src/**/*.rs", "/README.md", "/LICENSE", "/Cargo.toml"]
unstable = [
"unstable_auth_methods",
"unstable_cancel_request",
"unstable_logout",
"unstable_session_fork",
"unstable_session_model",
"unstable_session_resume",
Expand All @@ -27,6 +28,7 @@ unstable = [
]
unstable_auth_methods = []
unstable_cancel_request = []
unstable_logout = []
unstable_session_fork = []
unstable_session_model = []
unstable_session_resume = []
Expand Down
117 changes: 116 additions & 1 deletion docs/protocol/draft/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
<ResponseField name="agentCapabilities" type={<a href="#agentcapabilities">AgentCapabilities</a>} >
Capabilities supported by the agent.

- Default: `{"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false},"sessionCapabilities":{}}`
- Default: `{"auth":{},"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false},"sessionCapabilities":{}}`

</ResponseField>
<ResponseField name="agentInfo" type={<><span><a href="#implementation">Implementation</a></span><span> | null</span></>} >
Expand All @@ -158,6 +158,61 @@ The client should disconnect, if it doesn't support this version.

</ResponseField>

### <span class="font-mono">logout</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Logs out of the current authenticated state.

After a successful logout, all new sessions will require authentication.
There is no guarantee about the behavior of already running sessions.

#### <span class="font-mono">LogoutRequest</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for the logout method.

Terminates the current authenticated session.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object | null"} >
The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Implementations MUST NOT make assumptions about values at
these keys.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)

</ResponseField>

#### <span class="font-mono">LogoutResponse</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response to the `logout` method.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object | null"} >
The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Implementations MUST NOT make assumptions about values at
these keys.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)

</ResponseField>

<a id="session-cancel"></a>
### <span class="font-mono">session/cancel</span>

Expand Down Expand Up @@ -1555,6 +1610,33 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
The ID of the request to cancel.
</ResponseField>

## <span class="font-mono">AgentAuthCapabilities</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Authentication-related capabilities supported by the agent.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object | null"} >
The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Implementations MUST NOT make assumptions about values at
these keys.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)

</ResponseField>
<ResponseField name="logout" type={<><span><a href="#logoutcapabilities">LogoutCapabilities</a></span><span> | null</span></>} >
Whether the agent supports the logout method.

By supplying `\{\}` it means that the agent supports the logout method.

</ResponseField>

## <span class="font-mono">AgentCapabilities</span>

Capabilities supported by the agent.
Expand All @@ -1575,6 +1657,16 @@ these keys.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)

</ResponseField>
<ResponseField name="auth" type={<a href="#agentauthcapabilities">AgentAuthCapabilities</a>} >
**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Authentication-related capabilities supported by the agent.

- Default: `{}`

</ResponseField>
<ResponseField name="loadSession" type={"boolean"} >
Whether the agent supports `session/load`.
Expand Down Expand Up @@ -2706,6 +2798,29 @@ If not provided, the name should be used for display.
for debugging or metrics purposes. (e.g. "1.0.0").
</ResponseField>

## <span class="font-mono">LogoutCapabilities</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Logout capabilities supported by the agent.

By supplying `\{\}` it means that the agent supports the logout method.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object | null"} >
The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Implementations MUST NOT make assumptions about values at
these keys.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)

</ResponseField>

## <span class="font-mono">McpCapabilities</span>

MCP capabilities supported by the agent
Expand Down
38 changes: 28 additions & 10 deletions docs/rfds/logout-method.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,27 @@ interface LogoutResponse {

### Capability Advertisement

The `logout` capability should be advertised within a new `authCapabilities` object in `AgentCapabilities`:
The `logout` capability should be advertised within a new `auth` object in `AgentCapabilities`:

```typescript
interface AgentCapabilities {
// ... existing fields ...

/** Authentication-related capabilities */
authCapabilities?: AuthCapabilities;
auth?: AgentAuthCapabilities;
}

interface AuthCapabilities {
interface AgentAuthCapabilities {
/** Extension metadata */
_meta?: Record<string, unknown>;

/** Agent supports the logout method */
logout?: boolean;
/** Agent supports the logout method. Supply `{}` to indicate support. */
logout?: LogoutCapabilities;
}

interface LogoutCapabilities {
/** Extension metadata */
_meta?: Record<string, unknown>;
}
```

Expand All @@ -90,17 +95,30 @@ interface AuthCapabilities {
```json
{
"$defs": {
"AuthCapabilities": {
"AgentAuthCapabilities": {
"description": "Authentication-related capabilities supported by the agent.",
"properties": {
"_meta": {
"additionalProperties": true,
"type": ["object", "null"]
},
"logout": {
"type": "boolean",
"default": false,
"description": "Whether the agent supports the logout method."
"allOf": [
{
"$ref": "#/$defs/LogoutCapabilities"
}
],
"description": "Whether the agent supports the logout method. Supply `{}` to indicate support."
}
},
"type": "object"
},
"LogoutCapabilities": {
"description": "Logout capabilities supported by the agent. Supply `{}` to indicate support.",
"properties": {
"_meta": {
"additionalProperties": true,
"type": ["object", "null"]
}
},
"type": "object"
Expand Down Expand Up @@ -159,7 +177,7 @@ interface AuthCapabilities {
### Behavior

1. **Pre-condition**: The client should only call `logout` if:
- The agent advertises `authCapabilities.logout: true`
- The agent advertises `auth.logout: {}`

2. **Agent responsibilities**:
- Invalidate any stored tokens or credentials as appropriate
Expand Down
1 change: 1 addition & 0 deletions schema/meta.unstable.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"agentMethods": {
"authenticate": "authenticate",
"initialize": "initialize",
"logout": "logout",
"session_cancel": "session/cancel",
"session_close": "session/close",
"session_fork": "session/fork",
Expand Down
86 changes: 86 additions & 0 deletions schema/schema.unstable.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
{
"$defs": {
"AgentAuthCapabilities": {
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication-related capabilities supported by the agent.",
"properties": {
"_meta": {
"additionalProperties": true,
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
"type": ["object", "null"]
},
"logout": {
"anyOf": [
{
"$ref": "#/$defs/LogoutCapabilities"
},
{
"type": "null"
}
],
"description": "Whether the agent supports the logout method.\n\nBy supplying `{}` it means that the agent supports the logout method."
}
},
"type": "object"
},
"AgentCapabilities": {
"description": "Capabilities supported by the agent.\n\nAdvertised during initialization to inform the client about\navailable features and content types.\n\nSee protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)",
"properties": {
Expand All @@ -8,6 +30,15 @@
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
"type": ["object", "null"]
},
"auth": {
"allOf": [
{
"$ref": "#/$defs/AgentAuthCapabilities"
}
],
"default": {},
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nAuthentication-related capabilities supported by the agent."
},
"loadSession": {
"default": false,
"description": "Whether the agent supports `session/load`.",
Expand Down Expand Up @@ -220,6 +251,14 @@
],
"title": "AuthenticateResponse"
},
{
"allOf": [
{
"$ref": "#/$defs/LogoutResponse"
}
],
"title": "LogoutResponse"
},
{
"allOf": [
{
Expand Down Expand Up @@ -842,6 +881,15 @@
"description": "Authenticates the client using the specified authentication method.\n\nCalled when the agent requires authentication before allowing session creation.\nThe client provides the authentication method ID that was advertised during initialization.\n\nAfter successful authentication, the client can proceed to create sessions with\n`new_session` without receiving an `auth_required` error.\n\nSee protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)",
"title": "AuthenticateRequest"
},
{
"allOf": [
{
"$ref": "#/$defs/LogoutRequest"
}
],
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLogs out of the current authenticated state.\n\nAfter a successful logout, all new sessions will require authentication.\nThere is no guarantee about the behavior of already running sessions.",
"title": "LogoutRequest"
},
{
"allOf": [
{
Expand Down Expand Up @@ -1783,6 +1831,7 @@
}
],
"default": {
"auth": {},
"loadSession": false,
"mcpCapabilities": {
"http": false,
Expand Down Expand Up @@ -1990,6 +2039,43 @@
"x-method": "session/load",
"x-side": "agent"
},
"LogoutCapabilities": {
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nLogout capabilities supported by the agent.\n\nBy supplying `{}` it means that the agent supports the logout method.",
"properties": {
"_meta": {
"additionalProperties": true,
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
"type": ["object", "null"]
}
},
"type": "object"
},
"LogoutRequest": {
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for the logout method.\n\nTerminates the current authenticated session.",
"properties": {
"_meta": {
"additionalProperties": true,
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
"type": ["object", "null"]
}
},
"type": "object",
"x-method": "logout",
"x-side": "agent"
},
"LogoutResponse": {
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nResponse to the `logout` method.",
"properties": {
"_meta": {
"additionalProperties": true,
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)",
"type": ["object", "null"]
}
},
"type": "object",
"x-method": "logout",
"x-side": "agent"
},
"McpCapabilities": {
"description": "MCP capabilities supported by the agent",
"properties": {
Expand Down
Loading
Loading