GrokIndex.devList your bot, free

How Grok Bot Handles Secrets and Credentials: Security Best Practices

Learn where Grok Bot stores OAuth tokens, passwords, and API keys—and how you stay in control.

GrokIndex Team9 min read

How Grok Bot Handles Secrets and Credentials: Security Best Practices

Your Grok Bot needs access to APIs, databases, and services. The question is: where do the passwords, tokens, and keys actually live, and who can see them?

Grok Bot treats credentials differently than most automation tools. A Bot has no identity of its own—it acts as the signed-in member. That design choice cascades into how secrets are stored, rotated, and audited. Understanding the model is the fastest way to keep high-value accounts safe.

This post covers what stays out of the model's hands, where connector tokens live, the secure secret request for passwords, and how to set approval boundaries before a Bot touches production systems.

Bots Have No Identity—Only Members Do

A Grok Bot cannot hold its own credentials. Every action it takes is attributable to a named member, and that member's identity is the Bot's only identity.

This is a fundamental security property: there is no separate machine account to provision, rotate, or audit. If you revoke the member's access in your identity provider, every Bot they own loses access automatically. If you remove the member from the team, their computers terminate, and the next login starts fresh.

Because a Bot acts as the member, it can never hold more access than the person it belongs to. That simplifies the permission model: you do not need to grant elevated access to bots or create special service accounts. Instead, you grant bots the tools and boundaries they need, and the member's own access is the ceiling.

Connector Tokens Never Touch Your Computer

For supported services—Slack, GitHub, Google Workspace, Notion, and others—Grok Bot offers connectors. When you authenticate a connector, the OAuth token stays on Cursor's backend. The Bot invokes the tool without ever receiving the token, and it never gets stored on the shared computer.

This is true even in a team setting. Team-managed connectors are the one exception: they may use team or service-account credentials, and an admin approves which connectors each team member can access. For personal Bots, connectors authenticate through your own OAuth flow, and the token remains server-side.

The workflow is simple:

  1. Bot requests a connector action (e.g., "post to Slack").
  2. Cursor's backend checks the OAuth token and applies any rate limits or permissions your team has set.
  3. The action runs without the token ever being visible on the computer.

This means you can safely use connectors for routine tasks without worrying that a Bot's memory, routines, or even a compromised routine could leak the token. The security boundary is enforced by the infrastructure, not by the Bot's behavior.

Passwords and One-Time Codes: You Enter Them

When a Bot reaches a step that requires a password, two-factor code, or payment information, it cannot type them. Instead, it hands the computer to you.

The workflow is explicit: the Bot stops and asks you to take over the computer. You enter the password or code yourself. For supported services, a secure secret request masks the entered value—it does not appear in the transcript, the chat history, or anywhere the model can see it. The credential stays confined to the login form.

This prevents credentials from ever entering the model's context window, where they could be leaked in memory, logged, or included in debug output. It also means a Bot cannot accidentally paste a password into the wrong field or send it to an unexpected endpoint.

When the login is complete, you hand control back to the Bot, and it continues with the work.

For routine, unattended work—skills and routines that run on a schedule—this handoff model still applies. If a routine encounters a login step, it pauses and waits for you to provide the credential. That is by design: it prevents routines from storing or attempting to enter credentials without human oversight.

Credential Type How It's Handled When It's Used
OAuth Token (Connector) Server-side, never on computer Connector actions (Slack, GitHub, etc.)
Password You enter it; masked input; not in transcript Login, payment, sensitive forms
One-Time Code (2FA) You enter it; masked input; not in transcript Multi-factor authentication
API Key (explicit) You store it on the computer, in workspace files Your code, scripts, routines you write

Where You Store API Keys and Secrets

Some tasks require an API key that you supply explicitly—perhaps your own OpenWeather key, a database password, or a service account credential for a tool without a connector.

You control where these live: typically in a file on the shared computer, in environment variables, or in your Bot's memory. Because all your Bots share the same computer, any Bot can theoretically read files or environment variables you place there.

This is where explicit boundaries matter. Before you create a routine that handles secrets:

  1. Store the secret in a single, narrow location (e.g., a single env file, not scattered in memory or chat).
  2. State the boundary in the Bot's identity or in the routine instruction: "Use the API key in /workspace/.env, never log it, never send it anywhere except the API endpoint."
  3. Use approval prompts if the Bot makes external calls or writes files.

For example, a routine that reconciles bank data might store the bank API key in a locked-down file and include this instruction:

You have access to /workspace/.bank-secrets. These contain banking credentials.
Use them only to connect to our primary bank API at api.bank.com. Never log these values,
never send them in chat, never use them for any other purpose. Ask for approval before
writing any file outside /workspace/audit/.

The approval requirement creates a checkpoint: you review the data and the destination before the Bot writes anything to an external service or a shared file.

Audits and Logs: Who Sees What

Grok Bot's audit logs (Enterprise only) cover control-plane events: Bot creation, member access changes, and routine creation. They do not include the content of conversations or the secrets themselves.

Action Recording (Enterprise only) captures Bot actions in a sanitized form, with shell commands scrubbed to remove passwords. This sanitization is automatic; you do not have to edit logs yourself.

For individual users, the transcript is private to your conversation. If you include a secret in chat, it stays in that conversation. A Bot's memory—the notes it saves about your preferences and prior work—is also private.

The shared computer has durable disk storage across sessions, so files and browser sessions persist. Deleting a Bot does not delete files from the computer or sign out of websites. You must clean up manually: sign out of services, delete sensitive files, and revoke plugin authorizations.

Approval and Auto-Review: Boundaries Before Work

The strongest protection is the one you state upfront in the Bot's initial instruction. Tell a Bot what it may change and where it must stop:

Reconcile the campaign data with the last month's spend. Do not change the campaign settings or message the agency. After showing me the proposed budget change, ask for approval before I submit anything.

An explicit approval boundary forces a review step. The conversation shows the proposed action, and you choose: Allow once (this action only), Always allow (save a rule for matching actions), or Deny (block it).

Auto-review is a second layer (Enterprise only): an independent review model that evaluates risky Bot actions—shell commands, plugin calls, computer use, and automation writes—before they run. It can let an action proceed, require your approval, or deny it. Admins can enforce Auto-review and add team-wide rules so every Bot on the team respects the same boundaries.

For a Bot that handles credentials or makes external changes, combine both:

  1. Write an explicit approval boundary into the Bot's identity.
  2. Configure Auto-review rules (Enterprise) to double-check actions that touch secrets or external systems.

Key Takeaways

  • Bots act as members, not machines. There is no separate bot identity to provision or rotate; the member's access is the ceiling.
  • Connector tokens stay server-side. OAuth tokens for supported services never touch your computer or the model's context.
  • You enter passwords yourself. Two-factor codes, payment info, and sensitive login steps bypass the Bot entirely—you type them, masked, in a secure input.
  • Explicit boundaries prevent accidents. State what a Bot may change and where it must ask before writing instructions; approval checkpoints are your strongest defense.
  • Audit logs are enterprise-only. Individual users rely on conversation privacy and manual cleanup; sensitive files do not delete when a Bot is removed.
  • Routines inherit all security controls. Scheduled, unattended routines face the same approval gates and credential-handling rules as one-off tasks.
  • Multi-layer approach wins. Combine connector auth (server-side), approval prompts (you review), and Auto-review rules (independent verification) to build defense in depth.

FAQ

Can a Grok Bot template steal my credentials? No. A template carries the Bot's job description, skills, and routines, but never your logins or conversation history. When you add a template, you get an independent copy you own. Connectors use server-side tokens the template cannot access. If a routine or skill in the template tries to collect credentials, you see it in the approval prompt or the Auto-review check before it runs.

What happens if someone adds a Grok Bot that asks for passwords in memory? If a template's identity prompt or a routine tries to gather passwords, you see the suspicious instruction during setup. Before you confirm adding the template, audit the identity section and all routines listed. If you do not see them before adding, check /home/box/agent-data/agents/<id>/profile.json and automations/ after you import. Anything asking for passwords in memory is a red flag—do not keep it enabled.

How do I rotate API keys without rebuilding the Bot? Store the key in a single file or environment variable, and reference it by path in your Bot's instructions or in the code it runs. When you need to rotate the key, update the file or env variable—the Bot picks up the new value on the next run without needing a redesign.

Do my Bots see each other's memories? No. Each Bot's memory is private. Bots can share files on the shared computer and read each other's output in the conversation, but one Bot cannot read another Bot's saved memory or conversation history. Anything placed in a shared file on the disk (by design or by accident) is visible to all Bots, so treat /workspace/ as shared and keep secrets in a restricted location with clear file permissions.

Explore More

Learn how to safely audit templates before adding them in the security checklist. See real examples of credentials and approvals in the identity prompt guide.

Explore how Grok Bot handles memory and context across sessions in memory and context work.

For creators building templates to share, visit GrokIndex to submit your bot and reach adopters who care about security and transparency.

Ready to put this into practice?Browse the Grok bot directory for ready-made templates, or list your own bot free.

Related articles

How to Safely Add a Grok Bot Template: A Security Checklist

Learn what happens when you add a Grok Bot template, how to audit permissions before confirming, and how to run templates safely on your shared cloud computer.

10 min read
grok bot

How Grok Bot Memory and Context Work: Building Persistent Assistants

Learn how Grok Bot builds and retains working memory, what persists across sessions, what doesn't, and how to design bots that learn from their work.

11 min read
grok-bot

How to Write a Grok Bot Identity Prompt (With 5 Working Patterns)

Learn how to write identity prompts that shape your bot's reasoning and judgment. Five working patterns with code examples and testing strategies.

10 min read
grok-bot