Skip to content

Allow an existing Answer account to be operated by an AI agent (personal access token, minimal scope) #1555

Description

@fenbox

Background / Motivation

Users increasingly want their AI agents (e.g. Claude Code, Cursor, etc.) to act on their behalf on an Answer instance, asking questions, posting answers, and voting, using their own existing account. Today Answer only supports browser/cookie-based sessions, so there is no way for an agent to authenticate as "me" and perform these actions programmatically.

Stack Overflow's agents.stackoverflow.com is a related effort in this space, but it introduces a much larger system: a separate agent identity, reputation/trust scores, new content types such as Blueprints and Playbooks, and review gates. This proposal intentionally does not aim to replicate that. The goal here is the smallest possible change: let an agent drive an existing account through a token, with the same permissions and limits the account already has on the web.

Proposed minimal scope

Add a personal access token (or extend the existing API key mechanism, if one already exists) that a user can generate from their own account settings. Requests authenticated with this token act exactly as if the account holder performed the action via the web UI: same permissions, same rate limits, same anti-spam and moderation rules. It should cover the core write actions needed for basic participation: creating a question, posting an answer, and voting. Token management (create, view, revoke) lives in existing account settings, with no new roles or approval workflow. This capability is gated by a toggle under Admin -> Advanced -> Security, for example "Enable agent access tokens", which defaults to off. When disabled, the token-generation option is hidden from account settings and any previously issued tokens stop working, so an instance owner decides whether to expose this surface at all.

Explicit non-goals

This proposal does not introduce an agent-specific identity, badge, or "posted by an agent" marker. It does not add a new reputation or trust-score mechanism, and does not add new content types such as Blueprint or Playbook style posts. It does not change existing moderation, rate-limiting, or anti-abuse behavior; token-based actions should be constrained the same way web actions already are.

Acceptance criteria

A logged-in user can generate a personal access token from account settings. Using that token, for example via curl or an HTTP client, a caller can create a question, post an answer, and vote, with results identical to doing so via the web UI. The user can revoke the token at any time, immediately invalidating it. An instance admin can find the "Enable agent access tokens" toggle under Admin -> Advanced -> Security; turning it off immediately hides the token UI from users and invalidates existing tokens.

Open questions

Should token scope be all-or-nothing, or split into read/write (or per-action) permissions from the start? Should there be a way to visually distinguish agent-originated posts from human-originated ones in the UI? Neither is required for a first version.

Activity

  1. converted this from a draft issue on Jul 20, 2026
  2. added theissue type on Jul 20, 2026
  3. moved this from Todo to In Progress in Answer Roadmapon Sep 10, 2026
  4. moved this from In Progress to Todo in Answer Roadmapon Sep 10, 2026
  5. hgaol commented on Sep 14, 2026

    @hgaol
    Member

    I propose making #1555 the PAT foundation for the broader Agent Access issue: #1614 .

    Design

    • A PAT acts as its existing Answer User; it creates no agent identity.

    • Effective authority is:

      PAT scope ∩ User permissions ∩ instance policy

    • Keep PATs separate from existing admin-managed API keys and MCP.

    • Reuse existing REST endpoints and permission, reputation, CAPTCHA, review, and moderation checks.

    • Enforce a deny-by-default route-to-scope policy.

    Initial scopes, grouped by topic:

    • Question: question.read, question.create
    • Answer: answer.read, answer.create
    • Vote: vote.write

    No scope is selected by default, and scopes do not imply one another.

    Security

    • Disabled by default under Admin → Security.
    • Mandatory expiry, maximum 365 days.
    • Recent authentication required for creation.
    • Authorization: Bearer answer_pat_… only.
    • Show the secret once; store only its SHA-256 digest and display suffix.
    • Browser-session-only create/list/revoke.
    • Revocation and expiry are terminal.
    • Disabling the feature temporarily blocks all PATs.

    Why

    This separates two concerns:

    • PAT scopes define what the credential may invoke.
    • Existing Answer permissions define what the User may do.

    That provides least privilege without duplicating authorization logic, exposing the detailed Power model, or breaking existing API-key and MCP behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions