Overview
PentAGI uses session-based authentication with support for multiple authentication providers. All API requests require valid authentication.Authentication Methods
Local Authentication
Authenticate with username and password:OAuth Providers
PentAGI supports OAuth authentication via:Google OAuth
Authenticate using Google accounts
GitHub OAuth
Authenticate using GitHub accounts
OAuth Flow
- Initiate OAuth
- Handle Callback
- Session Cookie
auth.
Session Management
Session Duration
Sessions are valid for 4 hours by default. The session timeout can be configured during server setup.Check Authentication Status
Verify your current session:Logout
End your session:Using Sessions with GraphQL
Include the session cookie in all GraphQL requests:WebSocket Authentication
For GraphQL subscriptions over WebSocket:- Establish WebSocket connection with session cookie
- Send connection init message
- User ID is extracted from the session
Permissions
PentAGI implements role-based access control (RBAC). Each user role has specific permissions:Permission Scopes
flows.view
flows.view
View flows owned by the authenticated user
flows.admin
flows.admin
View and manage all flows (admin only)
providers.view
providers.view
Access LLM provider configurations
containers.view
containers.view
View Docker containers for user’s flows
termlogs.view
termlogs.view
Access terminal logs for user’s flows
Error Responses
401 Unauthorized
403 Forbidden
Security Best Practices
CORS Configuration
Configure allowed origins via theCORS_ORIGINS environment variable:
Cookie Security
Session cookies are signed using theCOOKIE_SIGNING_SALT environment variable. Keep this secret secure.