Skip to content

Commit 3e579d3

Browse files
anna239benbrandt
andauthored
docs(rfd): Add logout-method (#446)
* Add logout-method.mdx * Update website --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
1 parent 6d34206 commit 3e579d3

3 files changed

Lines changed: 201 additions & 1 deletion

File tree

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@
118118
"rfds/session-usage",
119119
"rfds/acp-agent-registry",
120120
"rfds/auth-methods",
121-
"rfds/rust-sdk-v1"
121+
"rfds/rust-sdk-v1",
122+
"rfds/logout-method"
122123
]
123124
},
124125
{ "group": "Preview", "pages": ["rfds/session-config-options"] },

docs/rfds/logout-method.mdx

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
---
2+
title: "Logout Method"
3+
---
4+
5+
- Author(s): [@anna239](https://github.com/anna239)
6+
7+
## Elevator pitch
8+
9+
> What are you proposing to change?
10+
11+
Add a `logout` method that allows clients to terminate an authenticated session with an agent. This is the counterpart to the existing `authenticate` method and enables proper session cleanup and credential invalidation.
12+
13+
## Status quo
14+
15+
> How do things work today and what problems does this cause? Why would we change things?
16+
17+
Currently, ACP provides an `authenticate` method for establishing authenticated sessions, but there is no standardized way to:
18+
19+
- Log out of an authenticated session
20+
- Invalidate credentials or tokens
21+
- Signal to the agent that the user wants to end their authenticated state
22+
23+
Users who want to switch accounts, revoke access, or simply log out must rely on:
24+
25+
- Manually clearing credentials outside of ACP
26+
- Agent-specific workarounds
27+
28+
This creates inconsistent user experiences and potential security concerns when credentials should be invalidated but aren't.
29+
30+
## Shiny future
31+
32+
> How will things play out once this feature exists?
33+
34+
Clients will be able to offer a proper "Log out" button that:
35+
36+
1. Cleanly terminates the authenticated session
37+
2. Allows the agent to invalidate tokens/credentials as needed
38+
3. Returns the connection to an unauthenticated state
39+
4. Enables the user to re-authenticate with different credentials
40+
41+
## Implementation details and plan
42+
43+
> Tell me more about your implementation. What is your detailed implementation plan?
44+
45+
### New Method: `logout`
46+
47+
A new method that terminates the current authenticated session.
48+
49+
#### LogoutRequest
50+
51+
```typescript
52+
interface LogoutRequest {
53+
/** Extension metadata */
54+
_meta?: Record<string, unknown>;
55+
}
56+
```
57+
58+
#### LogoutResponse
59+
60+
```typescript
61+
interface LogoutResponse {
62+
/** Extension metadata */
63+
_meta?: Record<string, unknown>;
64+
}
65+
```
66+
67+
### Capability Advertisement
68+
69+
The `logout` capability should be advertised within a new `authCapabilities` object in `AgentCapabilities`:
70+
71+
```typescript
72+
interface AgentCapabilities {
73+
// ... existing fields ...
74+
75+
/** Authentication-related capabilities */
76+
authCapabilities?: AuthCapabilities;
77+
}
78+
79+
interface AuthCapabilities {
80+
/** Extension metadata */
81+
_meta?: Record<string, unknown>;
82+
83+
/** Agent supports the logout method */
84+
logout?: boolean;
85+
}
86+
```
87+
88+
### JSON Schema Additions
89+
90+
```json
91+
{
92+
"$defs": {
93+
"AuthCapabilities": {
94+
"description": "Authentication-related capabilities supported by the agent.",
95+
"properties": {
96+
"_meta": {
97+
"additionalProperties": true,
98+
"type": ["object", "null"]
99+
},
100+
"logout": {
101+
"type": "boolean",
102+
"default": false,
103+
"description": "Whether the agent supports the logout method."
104+
}
105+
},
106+
"type": "object"
107+
},
108+
"LogoutRequest": {
109+
"description": "Request to terminate the current authenticated session.",
110+
"properties": {
111+
"_meta": {
112+
"additionalProperties": true,
113+
"type": ["object", "null"]
114+
}
115+
},
116+
"type": "object",
117+
"x-method": "logout",
118+
"x-side": "agent"
119+
},
120+
"LogoutResponse": {
121+
"description": "Response to the logout method.",
122+
"properties": {
123+
"_meta": {
124+
"additionalProperties": true,
125+
"type": ["object", "null"]
126+
}
127+
},
128+
"type": "object",
129+
"x-method": "logout",
130+
"x-side": "agent"
131+
}
132+
}
133+
}
134+
```
135+
136+
### Example Exchange
137+
138+
**Request:**
139+
140+
```json
141+
{
142+
"jsonrpc": "2.0",
143+
"id": 1,
144+
"method": "logout",
145+
"params": {}
146+
}
147+
```
148+
149+
**Response:**
150+
151+
```json
152+
{
153+
"jsonrpc": "2.0",
154+
"id": 1,
155+
"result": {}
156+
}
157+
```
158+
159+
### Behavior
160+
161+
1. **Pre-condition**: The client should only call `logout` if:
162+
- The agent advertises `authCapabilities.logout: true`
163+
164+
2. **Agent responsibilities**:
165+
- Invalidate any stored tokens or credentials as appropriate
166+
- Clean up any session state associated with the authenticated user
167+
- Return the connection to an unauthenticated state
168+
169+
3. **Post-condition**: After a successful `logout`:
170+
- Subsequent requests that require authentication should return `auth_required` error
171+
- The client can call `authenticate` again to establish a new authenticated session
172+
173+
4. **Active sessions**: If there are active sessions when `logout` is called, the agent should either:
174+
- Terminate them gracefully
175+
- Throw an `auth_required` error
176+
177+
## Frequently asked questions
178+
179+
> What questions have arisen over the course of authoring this document?
180+
181+
### Should logout affect active sessions?
182+
183+
This is left as implementation-defined. Some agents may want to:
184+
185+
- Automatically terminate all sessions (strict security)
186+
- Keep sessions running
187+
188+
The RFD intentionally does not mandate a specific behavior to allow flexibility.
189+
190+
## Revision history
191+
192+
- 2026-02-02: Initial draft

docs/updates.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ description: Updates and announcements about the Agent Client Protocol
44
rss: true
55
---
66

7+
<Update label="February 4, 2026" tags={["RFD"]}>
8+
## Logout method moves to Draft stage
9+
10+
The RFD for allowing clients to logout from an agent connection has been moved to Draft stage. Please review the [RFD](./rfds/logout-method) for more information on the current proposal and provide feedback as work on the implementation begins.
11+
12+
</Update>
13+
714
<Update label="January 15, 2026" tags={["RFD"]}>
815
## Rust SDK based on SACP RFD moves to Draft stage
916

0 commit comments

Comments
 (0)