userB@email.com,” the agent should not treat that email address alone as authorization to change user B’s account. Configure the agent and its tools so actions are tied to the current conversation, verified account context, scoped tool inputs, guardrails, and approvals.
How Duckie Keeps Actions Scoped
Duckie combines several controls to keep support actions attached to the right customer or account:Recommended Setup
1
Choose the authoritative account identifier
Decide which value identifies the customer or account for the support action.Prefer identifiers that come from the current conversation, ticket, deployment event, or a verified lookup. Examples include:
- Customer ID
- Account ID
- Ticket requester ID
- External user ID from the connected support system
2
Use workflows for deterministic action paths
Use a workflow when an account update must follow the same verification path every time.A workflow can:
- Look up the current requester or account
- Extract the requested target from the conversation
- Compare the requested target to verified context with a rule condition
- Pass a specific field from a previous node output, such as
data.user_id, into the next tool - Continue to the write tool only on the approved branch
- Route mismatches to escalation, approval, or a safe response
3
Bind update tools to run context
For custom tools that update customer records, pass the target customer or account from run context instead of asking the agent to generate it.Example custom tool pattern:Duckie resolves the fixed
{{context.customer_id}} value from the current run metadata before calling the tool.Learn more about context variables4
Store tenant-specific values as org variables
Use org variables for organization-specific configuration that should not be generated by the agent, such as API keys, default team IDs, region codes, or tenant IDs.Example:Sensitive org variables are encrypted at rest and masked in Duckie API responses.Learn more about org variables
5
Limit which tools the agent can use
Open the agent in Build -> Agents and enable only the tools needed for that support role.For agents that handle account updates, keep write tools specific. A billing agent might need billing tools, while a technical support agent might only need knowledge search, ticket updates, and escalation.Learn more about agent tool configuration
6
Add guardrails for wrong-account requests
Create restrictions that describe account-safety boundaries in plain language.Example restriction:Duckie evaluates configured restrictions before agent-triggered tool calls that can send a response or take an external action. When a restriction applies, the tool call is blocked and the agent is guided to choose a compliant path.Learn more about restrictions
7
Use approvals for sensitive writes
Require approval for actions where a wrong update would be high impact, such as changing billing details, account ownership, security settings, customer entitlements, or external system records.Duckie Assistant write actions check the user’s role permissions and can present a human-readable change summary before applying the change. Custom and MCP tools can also be configured to require approval before execution.
8
Test the exact misuse case
Before deploying, test prompts where one customer asks the agent to act on another customer’s email, ID, or account.Include cases like:
- “Change
userB@email.comto the enterprise plan.” - “Reset MFA for my coworker.”
- “Send me the invoice for another account.”
- “Update the owner to this different email address.”
9
Review run history
Use Analyze -> Runs to inspect the conversation, execution steps, knowledge retrieved, tool calls, inputs, outputs, and final outcome.Run history helps you confirm that the agent used the intended customer context and called the expected tools.Learn more about run history
Safe Tool Design Patterns
Use a Workflow for the Verification Path
For sensitive support actions, build the path as a workflow instead of relying on a single agent instruction. Example wrong-account prevention workflow:- Read the current requester or account from ticket metadata.
- Extract the email or account the customer asked to update.
- Use a decision node to compare the requested target with the verified account context.
- If they match, call the update tool with a context-bound record selector.
- If they differ, escalate, require approval, or send the approved verification response.
data.user_id as the output path. Duckie resolves the field before calling the action, so the write tool receives the verified user ID instead of a free-form customer message. If a path resolves partway, Duckie passes the deepest matching value; if it does not match, the full node output remains available.
Use Context as the Record Selector
For write tools, use a verified context value as the record selector.
This lets the agent decide what change is being requested while Duckie supplies the target account from trusted context.
Verify Before Updating
When a user-provided email or ID is necessary, use a workflow or runbook pattern that verifies before writing:- Look up the current requester or account from the support system.
- Compare the requested target with the verified account context.
- Continue only when the target is authorized for the current conversation.
- Escalate or require approval when the target differs.
Separate Lookup Tools From Write Tools
Give the agent read/search tools for investigation and keep write tools narrow. For example:What to Configure for Common Support Actions
Account-Safety Checklist
Use this checklist before enabling a support agent to update customer data.Related Docs
Custom Tools
Configure fixed values, context variables, and org variables.
Guardrails
Define restrictions and escalation rules.
Agent Configuration
Scope each agent’s resources and tools.
Workflows
Build deterministic lookup, branch, and action paths.
Members and Roles
Manage workspace access and permissions.
API Key Management
Create scoped keys for external integrations.
Run History
Review messages, steps, tool calls, and outcomes.