{% extends "base.html" %} {% block title %}AI access — Steward{% endblock %} {% block head %} {% endblock %} {% block content %} {% set role_help = { "viewer": "Reads everything you can see. Changes nothing.", "operator": "Also runs playbooks and changes monitors and alerts.", "admin": "Full access, the same as an admin in the UI.", } %}

AI access

A token lets an AI client such as Claude Code connect to Steward over MCP and act as you, limited to the role you give the token. Everything a token changes is written to the audit log under your name.

Your tokens
{% if rows %}
{% for row in rows %} {% set t = row.token %} {% endfor %}
Name Role Created Last used Expires
{{ t.name }}
{{ t.prefix }}…
{{ t.role.value }} {{ t.created_at.strftime("%Y-%m-%d") }} {% if t.last_used_at %}{{ t.last_used_at|ago }}{% else %}Never{% endif %} {% if row.state == 'revoked' %}Revoked {% elif row.state == 'expired' %}Expired {% elif t.expires_at %}{{ t.expires_at.strftime("%Y-%m-%d") }} {% else %}Never{% endif %} {% if row.state == 'active' %}
{{ csrf_field() }}
{% endif %}
{% else %}
You have no tokens yet. Create one on the right, then paste it into your AI client.
{% endif %}
Create a token
{{ csrf_field() }}
{% for r in grantable %}
{{ r.value|capitalize }}: {{ role_help[r.value] }}
{% endfor %}
The token is shown once. A token never acts above your own role ({{ user_role.value }}), even if your role is lowered later.
{% set token = none %} {% include "ai_access/_connect.html" %}
{% endblock %}