
Key Takeaways
- For homegrown agents, embedding security in the build is your job. For homegrown agents, security in the build is your job. You own the guardrails, the testing, and the release pipeline, and as agents gain capabilities and autonomy, you need to keep re-checking your threat-model assumptions
- Gates beat guidelines. At higher maturity levels, AI-specific security testing is not only embedded in the release process. Failing guardrails and intent-drifting tests can block the pipeline instead of informing it.
- Protect the settings that define scope. Security-relevant configurations should live where the agent cannot and will not rewrite them.
Secure AI agent development is the area where the homegrown, code-first distinction matters most. When an organization buys a SaaS agent, the vendor owns the build, the guardrails, and the release pipeline. When an organization builds its own, every one of those belongs to the organization.
The temptation to skip them is strong, and the gaps leaving opportunities for human errors are real. On managed platforms such as Amazon Bedrock AgentCore or Azure AI Foundry, the platform most often handles the backend, and the rest feels like it should be quick. Teams assemble the remaining pieces from a template or an AI coding assistant, review the code, ship what works, and move on.
Domain 3 of the Homegrown Agent Maturity Model for Execution & Risk (HAMMER), Secure Development & Design, asks whether security is built into how agents are designed, tested, and shipped.
The Vibe-Coding Trap
Vibe-coding is productive, and it’s often how a proof of concept becomes production: the demo works, so it ships, and nobody reviews in depth what the agent can actually do. Code generated this way is reused and inherited by other components quickly, so one unreviewed shortcut can spread before anyone notices it.
Take, for example, a team that vibe-codes an agent from a starter template. The template ships with permissive defaults, such as a tool endpoint with no authentication or an API token with broader scope than the agent needs, and logging that records the final response but not the tool calls behind it. The team inherits all of it, and no one reviews it because the agent works. At Level 2 of the HAMMER model, this is the typical picture: developers trust inherited code, security is consulted informally and late, some guardrails exist (a system prompt, for example) but they’re inconsistent, and testing is ad hoc.
From Consulted Late to Designed In
Level 3 is the first point at which security becomes part of how agents are built rather than a late-stage blocker. Four practices define it:
- Secure-by-design guidelines exist and are communicated.
- Higher-risk agents are threat-modeled on an ongoing basis.
- Guardrails are standardized.
- Tools and Model Context Protocol (MCP) components are vetted.
In practice, standardized guardrails mean teams don’t write their own from scratch for each agent. They draw on a shared, approved set, such as input and output filtering, limits on which tools an agent may call, and logging for every tool invocation. Vetting means a tool or MCP server is reviewed before any agent is allowed to connect to it.
Threat modeling is worth a note here, because agents change what there is to model. Frameworks such as the Cloud Security Alliance’s MAESTRO approach this layer by layer, which is a useful starting point for teams that have only modeled conventional applications.
At this level, agents also get pre-production security testing and a posture review before release.
Making Security a Gate
At HAMMER’s Level 4, these practices start to become hard requirements. Security prerequisites gate the software development lifecycle (SDLC), which in practice means guardrail and policy checks run in the continuous integration and delivery (CI/CD) pipeline. Several things change at once:
- Posture is assessed before runtime. AI security posture management (AISPM) checks an agent’s configuration against policy during the build process every time it is edited.
- Runtime testing is routine. Dynamic testing and agent red-teaming stop being special projects, and the attack scenarios are informed by business-specific use cases.
- The supply chain is governed. An AI Software Bill of Materials (AI-SBOM) inventories the models, tools, and dependencies an agent relies on.
- A failing test blocks the release. Depending on the risk of a finding, guardrail or prompt-injection-like failures pause the pipeline.
One requirement deserves extra attention: treat the settings that define an agent’s scope as protected assets in their own right. System prompts, tool permissions, and guardrail configurations should live where the agent cannot rewrite them. This matters more as teams hand security tasks, such as managing security configurations, to coding agents to move faster. If an agent can edit the configuration that limits it, a precise, targeted attack can loosen those limits. And as agent-to-agent communication becomes routine, any agent that handles security configuration must be isolated from inputs that other agents can influence.
The Paved Road
At Level 5, security stops being a checklist developers have to remember and becomes the default path. Agents inherit guardrails, identity, and logging automatically from a secure-by-default template that is dynamically generated based on the specific engineering requirement. Posture is continuously aligned to policy, assessments such as adversarial testing are continuous and informed by business-use cases, and insecure practices are blocked at build time.
This is where security and speed stop competing. A developer who starts from a paved-road template gets identity, logging, guardrails, and posture checks without asking for them, so the secure option is also the fastest one. That’s a business case as much as a security one, and it’s the heart of what it means to innovate with AI, without compromising security.
Check Where Your Build Process Stands
Few teams can honestly say all of their agents are built the same way. Mapping where your teams sit, from template-driven shortcuts to a paved road, is the first step toward closing the gap, and it’s much easier to do with a shared scale.
Download the HAMMER eBook to see all five levels of Secure Development & Design and score your own build process.
All ArticlesRelated blog posts

Every AI Agent Needs Its Own Identity, Not a Borrowed One
AI agent identity is where good intentions most often meet shortcuts. A developer needs an agent to reach a database,...

You Can’t Secure the Homegrown AI Agents You Don’t Know You Have
Ask a security team how many homegrown AI agents the organization runs, and the room usually goes quiet. Engineering...

Introducing HAMMER, the Homegrown Agent Maturity Model for Execution & Risk
The Homegrown Agent Maturity Model for Execution & Risk (HAMMER): is a five-level framework with seven domains...
Secure Your Agents
We’d love to chat with you about how your team can secure and govern AI Agents everywhere.
Get a Demo