Environments and AI agents: what they can change, and what they never see

Letting an AI agent run your API requests raises the obvious worry: the environments hold tokens, passwords and production URLs. The Requestarium MCP server is built around one rule: the agent can use environments, and even write to them, but it never reads a value.

What the agent sees

Roughly this:

Output
Environments in "Team":
  Orders API / Local      baseUrl, apiKey*, adminToken*
  Orders API / Staging    baseUrl, apiKey*, adminToken*

Names and keys, with secrets marked. When it runs a request with run_request or run_collection, the CLI fills in the values on your machine and sends the request. The result the agent gets back has credentials masked: bearer tokens, passwords, API keys, Authorization and Cookie headers, and secrets in URLs such as ?api_key=…. If the agent tries to save a masked value back into a request, the server refuses, so a request never ends up with dots instead of its credential.

Values from AWS Secrets Manager, Azure Key Vault and Google Cloud Secret Manager are fetched on your machine and masked the same way.

What it can change

Three tools write to environments:

ToolTypical use
create_environment"Create a Local environment for this new collection"
set_environment_variable"Set baseUrl in Preview to https://pr-42.example.com"
delete_environment_variable"Remove the old v1BaseUrl variable"

Your MCP client asks before each tool call unless you've told it to always allow that tool. For these three, don't: read each call before approving it, including the environment, the key, and whether it's marked secret.

The server tells the agent to ask you before storing a credential, and to mark it secret. For secrets that live in a cloud secret manager, the agent can set the pointer (RQ_AWS_SECRET_NAME and friends) instead of the value.

What the response body shows

One thing isn't masked: response bodies. That's how the agent debugs. A request that returns a user list shows the agent that list; a login response shows it the token. Keep that in mind when you choose which collections and environments the agent works with.

Keep production out of reach

Masking protects values. It doesn't stop an agent from running a DELETE against production if production is one of its environments. Pick one of these, from strongest to weakest:

  1. A separate workspace for production, which the account the agent uses isn't a member of.
  2. A separate account for the agent with Viewer access where it only needs to look.
  3. Instructions: "Only use the Local and Staging environments. Never run requests against Production." Agents follow this well, but it's a rule, not a lock.

When an agent should ask you for a value

A good pattern for anything secret: the agent creates the variable with an empty value and marks it secret, then tells you to fill it in the app, or to run:

Terminal
echo "$TOKEN" | requestarium env set Staging apiKey - --secret

The value goes from your clipboard to the encrypted environment, and never through the chat.