How to Attach Guardrails to Agentspublic

Validated on 9 Oct 2024 • Last edited on 3 Apr 2025

The DigitalOcean GenAI Platform lets you work with popular foundation models and build GPU-powered AI agents with fully-managed deployment, or send direct requests using serverless inference. Create agents that incorporate guardrails, functions, agent routing, and retrieval-augmented generation (RAG) pipelines with knowledge bases.

Guardrails are security components you can attach to GenAI Platform agents. A guardrail overrides the agent’s output when it detects sensitive or inappropriate content in the input or response. For example, it can block the agent from sharing login credentials or credit card information. For details, see our list of supported guardrails.

GenAI supports three guardrails: sensitive data, jailbreak, and content moderation. You can further customize these guardrails by duplicating and editing them.

Note
If your agent handles sensitive data, we recommend reviewing our data privacy page for information about how we manage your data.

Attach Guardrails using the Control Panel

You can attach guardrails to agents in two ways. To simultaneously attach multiple guardrails to the same agent, use the agent’s Resource page. To simultaneously attach multiple agents to the same guardrail, use the Guardrails page.

Attach Multiple Guardrails to One Agent

To simultaneously attach multiple guardrails to the same agent, go to the DigitalOcean Control Panel. In the left menu, click GenAI Platform, then click the Agents tab to view your agents page. In the Agents section, find the agent you want to attach guardrails to, then click the Resources tab. Scroll to the Guardrails section and click Add guardrails.

This opens the Add guardrails window. Check the boxes next to the guardrails you want to attach, then click Save to confirm your changes.

Attach A Guardrail to One or More Agents

To simultaneously attach a guardrail to one or more agents, go to the DigitalOcean Control Panel. In the left menu, click GenAI Platform, then click Guardrails tab to view your guardrails page. To the right of the guardrail you want to attach, open the menu, then click Attach Agent.

This opens the Manage Agents window. Check the boxes next to the agents you want to attach, then click Update to confirm your changes.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.