Sales Assistant
| Tool call | Runs through | Credentials used | Result |
|---|---|---|---|
| search_my_files | Agent Gateway | Maya Lin (user-provided) | 4 files Maya can open |
| get_price_book | App tool | App service credentials | Current price book |
| update_opportunity | Agent Gateway | Maya Lin (user-provided) | Waiting for approval |
What matters here
- A Tray Helix agent acts as the user through Agent Gateway, with each tool's Dynamic Authentication set to user-provided.
- A user-provided tool runs on the asking user's own credentials, so the agent sees and changes only what that person can.
- Not every call needs to be personal: tools that read shared reference data can keep the app's service credentials.
- The activity log shows which credentials each call used, so an audit can tell the user's actions from the app's.
- Writes still wait for approval, even when they run as the user.
Who this is for
You are building an agent for a team whose systems have per-person permissions, such as a CRM, a file store or a ticketing tool. You need the agent to respect those permissions, not flatten them into one service account.
How it works in practice
One request, and the credentials each call uses.
- 1
A user asks the agent
"Find the latest proposal for Northwind and move the opportunity to negotiation."
- 2
Personal reads run as them
search_my_files runs through Agent Gateway with user-provided auth, so it finds only files this user can open.
- 3
Shared reads use the app
get_price_book reads reference data everyone may see, on the app's service credentials.
- 4
The write waits for approval
update_opportunity is marked for approval. After approval it runs as the user, so the CRM records them as the editor.
- 5
The log tells them apart
The activity log shows each call, where it ran and whose credentials it used.
What this agent is made of
Two kinds of tool, chosen one by one.
User-provided tools
Governed MCP tools in Agent Gateway with Dynamic Authentication set to user-provided. They run on the asking user's own credentials.
App tools
Tools in the app's code that use the app's service credentials, for data everyone may see.
Approval on writes
Every tool that changes data is marked for approval, whichever credentials it runs on.
An activity log
Each call, the route it took and the credentials it used, under the request that started the run.
The prompts
Paste these into Claude Code, Codex or Cursor in order. Each one leaves you with something that runs, so you can stop after any step.
These prompts start from a Helix project, which is what handles sign-in, credentials and hosting. Start with Helix.
The assistant app
Where people ask and approve.
Create a Helix app: a sales assistant agent for account executives.
People ask in plain language about their accounts and opportunities. Store each conversation per user, and show a list of actions waiting for approval.
On each run, show an activity list: each tool call, whether it ran through Agent Gateway or in the app, and which credentials it used.
Two kinds of tool
Personal where it should be, shared where it can be.
Add an agent to the app with these tools.
These call our Agent Gateway MCP server and run as the asking user:
- search_my_files: search Google Drive for files.
- get_my_opportunities: read the user's opportunities in Salesforce.
- update_opportunity: change stage, amount or close date.
This one is an app tool on the app's service credentials:
- get_price_book: read the current price book.
Mark update_opportunity as needing approval every time.
Connect it to real systems
Agent Gateway for the personal calls.
Now connect it to the systems we actually run.
Anything in angle brackets is a placeholder. Swap it for whatever we use.
<Agent Gateway>. Our MCP server with the Salesforce and Google Drive tools.
<Snowflake>. Read the price book on the app's service credentials.
Only write through update_opportunity. Everything else is read only.
Ship it
A URL, and the team on it.
Deploy my app.
What it connects to
The tools that should be personal run through Agent Gateway. The rest stay in the app.
-
Salesforce Read and update opportunities as the asking user, through Agent Gateway. Reads and writes
-
Google Drive Search files as the asking user, so results match what they can open. Reads
-
Snowflake Read the price book on the app's service credentials. Reads
Named systems are the ones most teams actually run, not a list of the only ones that work. Swap in whatever you use.
Running it for real
The build gets you a working agent. Running it means each call uses the right credentials and the log proves it.
- 1
Deploy the app and its agent together
One command, or Deploy from CI on every merge, takes the app to a live URL. The agent ships with its app, so you can roll back any deployment.
- 2
Calls on the user's credentials, when they should
Tools set to user-provided in Agent Gateway run as the asking user. Tools that don't need it use the app's service credentials.
- 3
Approval on every write
update_opportunity waits for a person, even though it runs as the user. The approver sees the tool and the exact input.
- 4
A log that shows whose credentials
The activity log shows which credentials each call used. Agent, workflow and audit logs stream to your SIEM.
- 5
Know what the assistant costs
AI usage shows per app, so the agent's cost sits next to the work it did.