Guardrails and secrets
Guardrails: limits the agent cannot talk its way past
Instructions can be ignored or overridden by clever input. Guardrails are limits the platform applies to every run whatever the instructions say. They are your hard walls.
Useful guardrails limit:
- Spend over a day, so a bug cannot burn through budget in an afternoon.
- Volume, such as the number of runs in a day.
- Destinations, so web calls can only go to named places.
- Amounts, so anything above a threshold needs a person.
Steps in PGB Agents
On the Edit tab, the Guardrails section has four settings. Leave a field empty for no limit, and choose Save changes to apply.
- Daily spend limit (USD).
- Runs per day.
- Allowed web domains: one per line. When set, web calls go only to these domains and their subdomains. This helps against both data leaving and an injected page sending the agent elsewhere.
- Ask me first when an amount is over: applies to any tool call with an argument named
amount,totalorvalueabove the number you set. Those calls pause for your approval.
Pick limits that match the job. A summariser of one news site needs one allowed domain. A weekly agent needs a runs-per-day limit of a few at most.
Secrets
Some agents need to call a service with a key. The rule is simple: a secret belongs in a secret store, never in instructions, inputs or memory, because those are shown, recorded and sometimes reused.
In PGB Agents, the Secrets section stores named secrets for an agent's web calls and connected servers:
- Choose a Name like
SERVICE_API_KEY(capital letters, numbers and underscores) and paste the Value. - Optionally fill Only send to these domains (optional) so the value can only go to the service it belongs to.
- Choose Add secret. From then on only the name and the last four characters show, and Replace secret swaps the value.
- In a web call's address, headers or body, write the placeholder
{{secret:NAME}}. It is filled in only when the call is made. The agent and the run history never see the value. - If a secret the agent needs is missing, a banner tells you which one. Remove deletes a secret.
The same idea applies to your AI key on the AI keys page and to a mailbox key in PGB Business access: both are write-only, and only the last four characters show.
Rotate and revoke
Rotate secrets on a schedule and whenever someone who knew one leaves. If you suspect a leak, remove or replace the secret first, then investigate. Do the same for a webhook address with Rotate secret, and revoke API keys you created in PGB Business.
Try it yourself
- Open an agent that has
http.fetch. In Guardrails, add one domain under Allowed web domains and save. - Run it with an address on a different domain. Read the failure in the trace and note that the agent was blocked even though the instructions said to fetch it.
- Under Secrets, add a practice secret named
PRACTICE_KEYwith a made-up value. Notice how the value is hidden afterwards, then Remove it.
Recap
- Guardrails are hard limits on spend, volume, destinations and amounts.
- Secrets live in the Secrets section as write-only values, referenced by
{{secret:NAME}}. - Never put secrets in instructions, inputs or memory, and rotate or revoke on any doubt.
Open Access Course
Free
forever- 9 structured lessons across 6 modules
- Interactive knowledge checks with instant feedback
- Verifiable completion certificate & PDF