Why This Approach
- No browser automation for OAuth — OAuth flows happen through Nexus off-host, no credential exposure on your machine
- Server-side token management — OAuth tokens stored in Nexus, never exposed to OpenClaw; all API calls proxied through MCP gateway
- Lower token usage — More efficient than browser automation, reducing AI processing costs
- Explicit MCP server authorization — You control which cloud services (Gmail, Calendar, etc.) OpenClaw can access via Nexus
- OAuth scope enforcement — Least-privilege by default (e.g., read-only); OpenClaw must request elevation for write operations
- Instant revocation — Terminate API access immediately without reconfiguring OpenClaw (revoke authorization or delete toolkit)
- Centralized MCP gateway — Manage all cloud service access from Nexus dashboard
- 30-day token expiration — Nexus access tokens automatically expire, requiring periodic re-authorization
What This Setup Secures (and What It Doesn’t)
✅ What Nexus Controls
- OAuth token management — Tokens issued and stored server-side in Nexus, never exposed to OpenClaw
- MCP server authorization — You authorize MCP servers (e.g., “Gmail”, “Google Calendar”) that OpenClaw can access
- OAuth scope enforcement — Least-privilege OAuth scopes (e.g., read-only Gmail initially) enforced at protocol level
- API request/response logging — Audit trail of requests and responses that pass through the MCP gateway (retained ~30 days)
- Guardrails at protocol layer — Block requests that violate configured rules (e.g., block write operations, size limits)
- Instant token revocation — Terminate cloud API access immediately by revoking authorizations or deleting toolkit
❌ What Nexus Does NOT Control
- Local file system access — OpenClaw can read/write files on the host machine without Nexus visibility
- Terminal/shell commands — OpenClaw can execute system commands directly on the host
- Network scanning tools — Capabilities like nmap, port scanning happen outside MCP protocol
- Headless browser actions — Web automation that bypasses MCP gateway entirely
- OpenClaw’s other Skills — Any non-MCP capabilities OpenClaw has installed
- Which specific MCP tools are called — Nexus authorizes servers, not individual tool calls within them
- Self-installation of MCP servers — Unless restricted to a specific toolkit, OpenClaw can add MCP servers without user approval
- ✅ Configure and authorize Nexus toolkit on a different machine
- ✅ Use OpenClaw on a separate machine that is NOT logged into Nexus
- ✅ Authorize OpenClaw’s requests via links sent to your email or accessed on another device
Your Security Responsibilities
When using OpenClaw with Nexus, you must also:- Restrict OpenClaw to a specific Nexus toolkit — Prevents OpenClaw from self-installing MCP servers
- Review and configure OAuth scopes — Start with least-privilege (read-only) and approve elevation requests
- Set up guardrails — Configure parameter presets and constraints within each MCP server’s settings
- Monitor token expiration — Nexus tokens expire after 30 days; you’ll need to re-authorize
- Disable unsafe OpenClaw Skills — Turn off terminal access, network tools, file system access if not needed
- Configure OS-level security — Set file permissions, firewall rules, sandboxing on OpenClaw host
- Monitor OpenClaw’s local logs — Local activity is not visible to Nexus
Install the Civic Nexus Skill
For the best experience, install the official Civic Nexus skill from ClawHub:Civic Nexus Skill
Quick Setup
The fastest way to get started is using our pre-configured OpenClaw toolkit prompt.Open the setup prompt in Nexus (on a DIFFERENT machine)
OpenClaw Quick Setup
Authorize the services
Copy your MCP URL and token
- MCP Gateway URL — safe to share (not secret)
- Access Token — keep this private (expires after 30 days)
Configure OpenClaw (on the OpenClaw host machine)
~/.openclaw/workspace/.env:~/.openclaw/openclaw.json:What’s Included in Safety Mode
The quick setup configures these defaults with least-privilege OAuth scopes:| Service | Allowed | Blocked |
|---|---|---|
| Gmail | Read emails, search, create drafts | Send emails |
| Calendar | View events, check availability | Create, modify, delete events |
Why safety mode?
Why safety mode?
Manual Setup
If you prefer to configure everything yourself or want different permissions:Create a Nexus account (on a separate machine)
Create a new toolkit
- Click Create Toolkit
- Name it (e.g., “openclaw” or “my-assistant”)
- Switch to this toolkit for the following steps
Add MCP servers
- Gmail (
gmail) — email access - Google Calendar (
calendar) — calendar access - Google Drive (
google-drive) — file access - PostgreSQL (
postgresql) — database queries - See all 100+ available servers
Configure OAuth scopes
- Start with least-privilege (read-only) scopes
- When OpenClaw needs elevated permissions, it will request approval via a link
- Approve elevation requests only when necessary and expected
Configure guardrails (optional)
- Use parameter presets to create hard limits the LLM cannot override
- Example: Limit Slack MCP server to only write to a specific channel
- Note: Guardrails apply per-MCP-server and cannot span across services
Generate your access token
Authorization Flow
When OpenClaw tries to use a service or needs elevated permissions:Nexus validates the request
- Is the MCP server authorized in this toolkit?
- Does the OAuth scope allow this operation?
- Do any guardrails block this request?
Approve if needed (on a different device)
Managing Access
You stay in control at all times.View active permissions
In Nexus, go to Authorizations to see all active MCP server connections and their OAuth scopes.Revoke access
Click Revoke on any authorization to immediately disable access. Revocation is instant — OpenClaw loses API access immediately.Delete toolkit
For complete access termination, delete the entire toolkit. This revokes all authorizations at once.Modify OAuth scopes
Edit your toolkit’s OAuth scope settings to enable or disable specific operation types without revoking the entire connection.Production Deployment & Security Considerations
🚨 CRITICAL: Machine Separation Requirement
NEVER log into Civic Nexus on the same machine where OpenClaw is running. If you are logged into Nexus locally, OpenClaw could potentially open your browser and authenticate on your behalf, bypassing all security controls. Required Setup for Production:- Nexus configuration machine — Use a separate, secure machine to:
- Create and configure your Nexus toolkit
- Authorize MCP servers and OAuth scopes
- Set up guardrails and parameter presets
- OpenClaw runtime machine — The machine running OpenClaw should:
- NEVER have an active Nexus login session
- Only have the MCP gateway URL and access token (via
.envfile) - Be used to authorize OpenClaw requests via email links or on another device
Required Additional Steps for Production
1. Restrict OpenClaw to a Specific Toolkit
1. Restrict OpenClaw to a Specific Toolkit
- Configure OpenClaw to use only your pre-authorized Nexus toolkit
- This prevents OpenClaw from self-installing additional MCP servers without your approval
- Follow the setup instructions in this guide to bind OpenClaw to your toolkit
2. Configure Least-Privilege OAuth Scopes
2. Configure Least-Privilege OAuth Scopes
- Start with read-only access for all services (Gmail read, Calendar read, etc.)
- When OpenClaw needs elevated permissions (e.g., send email, create event), it will send you an authorization link
- Approve elevation requests only when necessary and expected
3. Set Up MCP Server Guardrails
3. Set Up MCP Server Guardrails
- Configure guardrails within each MCP server’s settings in Nexus
- Use parameter presets to create hard limits the LLM cannot override
- Example: Limit Slack MCP server to only write to a specific channel
- Note: Guardrails apply per-MCP-server and cannot span across services
4. Implement System-Level Security Controls
4. Implement System-Level Security Controls
- Containerization/sandboxing (Docker, VM isolation) for OpenClaw host
- Network segmentation and firewall rules
- File system permissions limiting OpenClaw’s access
- Disable unnecessary OpenClaw Skills (terminal, network tools, browser automation)
5. Configure Monitoring and Token Management
5. Configure Monitoring and Token Management
- Monitor Nexus audit logs (API requests/responses retained ~30 days)
- Monitor OpenClaw’s local logs (not visible to Nexus)
- Set calendar reminders for 30-day Nexus token expiration
- Configure alerts for unexpected authorization elevation requests
6. Follow Enterprise Security Best Practices
6. Follow Enterprise Security Best Practices
- Principle of least privilege for all system access
- Regular security reviews of authorized MCP servers and OAuth scopes
- Incident response plan for compromised agents (immediate toolkit deletion or authorization revocation)
- Never deploy with production customer data or PII without comprehensive hardening
Shared Security Responsibility
Nexus provides:- OAuth token management and storage
- MCP server authorization enforcement
- OAuth scope enforcement (least-privilege, elevation requests)
- API request/response logging at the MCP gateway
- Guardrails at the protocol layer (when configured)
- Immediate token revocation capability
- Selecting and configuring AI agent software (OpenClaw)
- Securing the OpenClaw runtime environment (host machine)
- Never logging into Nexus on the OpenClaw host machine
- Restricting OpenClaw to a specific Nexus toolkit
- Disabling unsafe OpenClaw Skills and local capabilities
- Configuring guardrails and parameter presets in Nexus
- Monitoring both Nexus logs AND OpenClaw local logs
- Managing token expiration and re-authorization (every 30 days)
- Compliance with third-party service terms of service
- Reviewing and agreeing to the Civic Customer Product Specific Terms
Incident Response
If you suspect OpenClaw is compromised or acting erratically:- Immediately revoke access — Go to Nexus → Authorizations → Delete toolkit or revoke individual service authorizations
- Revocation is instant — OpenClaw will lose API access immediately
- Investigate locally — Check OpenClaw’s local logs and host machine for unauthorized actions
- Re-authorize carefully — When creating new toolkit, review all settings and start with minimal permissions
- Nexus cannot detect if OpenClaw has been compromised
- Nexus cannot emergency-stop an OpenClaw session (use toolkit deletion or authorization revocation)
- Nexus cannot detect if OpenClaw has direct OAuth grants outside Nexus
Result
✅ What You’ve Achieved:- OpenClaw accesses authorized cloud services via Nexus-managed OAuth tokens at the MCP protocol layer
- MCP server permissions are explicit, logged, and revocable in real-time
- OAuth tokens remain in Nexus server-side and are never exposed to OpenClaw
- Least-privilege OAuth scopes enforced by default; elevation requires your approval
- All cloud API requests/responses are logged in Nexus (retained ~30 days)
- Access managed via
nexus.civic.comfrom a separate machine (never log into Nexus on OpenClaw host)
- OpenClaw requests calendar data via MCP gateway
- Nexus validates MCP server authorization and OAuth scope
- If not authorized, Nexus sends you an approval link (access on different device/email)
- You approve, and calendar events are returned to OpenClaw
- All activity is logged in Nexus audit trail
- Access persists for 30 days (token expiration), then requires re-authorization
- You can instantly revoke access anytime by deleting toolkit or revoking authorization
Troubleshooting
'NEXUS_TOKEN environment variable is required'
'NEXUS_TOKEN environment variable is required'
.env file:'Authorization required' error
'Authorization required' error
'Elevation required' for write operations
'Elevation required' for write operations
Token expired
Token expired
Connection timeout
Connection timeout

