Skip to content

Secrets

Guida stores secrets (API keys, tokens, passwords, connection strings) encrypted with Windows DPAPI. Secrets are tied to your Windows user account — only your user can decrypt them.

Open the Secrets pane to add, view, and delete secrets. Each secret has:

  • Name — identifier used to reference the secret (e.g., API_TOKEN, my-postgres)
  • Value — the encrypted content (shown as masked in the UI)
  • Description — optional notes about what the secret is for

The toolbar offers Add Secret for generic key-value secrets, plus dedicated buttons for Add S3 Connection, Add MongoDB, Add PostgreSQL, and Add Elasticsearch that open typed dialogs with the right fields.

Secrets pane showing existing secrets and the Add S3 Connection dialog with fields for endpoint, access key, secret key, and region

Typed secret dialogs keep connection fields structured while storing the resulting credentials encrypted for your Windows user.

Read a secret’s decrypted value with g.secrets.getSecret():

async function main() {
const token = await g.secrets.getSecret("API_TOKEN");
const response = await g.http.makeHttpRequest({
url: "https://api.example.com/data",
headers: { "Authorization": "Bearer " + token }
});
}

The Secrets pane has dedicated dialogs for adding database connections. Each dialog collects the right fields for the service — no need to manually assemble connection strings.

ButtonDialog fieldsUsed by
Add S3 ConnectionName, Endpoint, Access Key, Secret Key, Region, Session Tokeng.s3.*
Add MongoDBName, Connection Stringg.mongodb.*
Add PostgreSQLName, Connection Stringg.postgres.*
Add ElasticsearchName, URL, Auth Mode (API Key, Basic, None), Credentialsg.elasticsearch.*

Add MongoDB Connection dialog showing Name, Connection String, and Description fields

Database connection secrets are referenced by name from scripts, so credentials do not need to be embedded in code.

Once saved, reference the secret by name in your scripts:

// The secret "my-mongo" holds the MongoDB connection string
const docs = await g.mongodb.find("my-mongo", "scraping", "products", {
price: { $lt: 20 }
});

See Database Integrations for full setup guides and examples.

Custom tools support {{SECRET_NAME}} templates in the headers field. The template is resolved at execution time — the AI agent never sees the header values:

{
"tools": [
{
"name": "fetch-data",
"description": "Fetch data from the API",
"script": "scripts/fetch.js",
"headers": {
"Authorization": "Bearer {{API_TOKEN}}",
"X-Api-Key": "{{API_KEY}}"
}
}
]
}

Secrets are designed to be invisible to AI agents connected via MCP:

The SecretsList MCP tool returns only names and descriptions — never decrypted values. There is no MCP tool to read secret values.

When an AI agent runs a script via MCP, that script’s g.secrets.getSecret() calls are blocked and throw an error. This prevents the exfiltration chain:

  1. AI tells Guida to run a script
  2. Script reads a secret with g.secrets.getSecret()
  3. Script writes the value to g.store
  4. AI reads the value from g.store

Step 2 is blocked — g.secrets.getSecret() checks the script’s origin and refuses MCP-origin requests.

This also applies to database integrationsg.s3.*, g.mongodb.*, g.postgres.*, and g.elasticsearch.* are all blocked for MCP-origin scripts, since they resolve connection secrets internally.

Queue workers started by MCP are also blocked — workers inherit the origin of their launcher.

  • SecretsList MCP tool — list secret names (not values)
  • Use secrets indirectly via custom tool headers templates (the script never sees the resolved value)