SPEC 018 — Equanaut AI Assistant
1. Feature Purpose
Equanaut is the AI assistant embedded in the Equa platform. It provides a conversational interface for users to query and manage their organizations, cap tables, members, documents, and equity plans. The assistant uses Claude with tool-calling to execute read and write operations on the user’s behalf, with a security layer that requires explicit confirmation for write/destructive operations. A secondary onboarding pipeline uses the same AI infrastructure to analyze uploaded documents and set up organizations for new users.2. Current State (Verified)
2.1 Agent Service (Backend Core)
2.2 Tool System
Tool Categories (from source):
2.3 Security & Guardrails
2.4 Context Assembly
2.5 Pending Confirmations
2.6 Onboarding Pipeline
2.7 System Prompt
2.8 Frontend API Configuration
3. Data Model
AgentConfig
ToolDefinition
PendingConfirmation (in-memory)
AgentAuditLog
OnboardingContext
4. API Endpoints
Chat & Tools
Onboarding (Authenticated)
Onboarding (Public)
5. Frontend Components
Module: equa-web/src/modules/equanaut/
Core Components:
Tool Execution & Confirmation:
Conversation Management:
Onboarding Flow:
Services:
Context Providers:
Hooks:
6. Business Rules
- Agent availability is gated by
ANTHROPIC_API_KEY— if absent,isAgentEnabled()returns false and all endpoints return disabled status. Can also be explicitly disabled viaAGENT_ENABLED=false. - Permission enforcement: Users can only access tools they have permissions for.
filterToolsByPermissions()strips unauthorized tools from the Claude tool list. - Organization access:
permissionProxy.hasOrganizationAccess()is checked before any chat request. Unauthorized users receive an error. - Confirmation flow: All write operations require user confirmation before execution. Destructive operations require double confirmation. Confirmations expire after 5 minutes.
- Rate limiting: Per user-org pair — max 30 tool calls/min, 10 write ops/min, 5 destructive ops/hour (configurable via env).
- Audit trail: Every tool execution is logged with user, org, tool, arguments, result, and timing.
- Context injection: The system prompt includes organization stats, cap table summary, member summary, and document summary for grounded responses.
- Batch tool execution: When Claude requests multiple tools, read-only tools execute immediately. The first write/destructive tool in a batch triggers confirmation, preserving prior tool results for continuation.
- Onboarding public endpoints:
create,get context,analysis-status,questions, andshowcaseare public (pre-registration). All mutation endpoints require authentication. - Onboarding expiry: Contexts have an
expiresAtfield; expired contexts transition toexpiredstatus. - Frontend retry: API calls retry up to 2 times with exponential backoff (1s initial, 10s max, 1.5x multiplier).
7. Acceptance Criteria
- User can open the Equanaut sidebar and send a chat message
- Agent responds with accurate information about the user’s organization
- Read-only tool calls execute without confirmation prompts
- Write operations display a confirmation dialog before execution
- Destructive operations display a double-confirmation dialog
- Confirmed actions execute and return results to the conversation
- Cancelled actions abort cleanly with a cancellation message
- Confirmation requests expire after 5 minutes
- Rate-limited requests return a clear error with retry timing
- Users without organization access receive a permission error
- Tool list is filtered to only show tools the user has permission for
- Onboarding flow: user can describe their company and get an AI-built organization
- Onboarding analysis extracts entities, equity info, and security types with confidence scores
- Clarifying questions flow works for ambiguous inputs
- Showcase displays extracted data with inline editing for corrections
- Agent audit log captures all tool executions
- Agent gracefully handles Anthropic API errors