Skip to content

Development

DevSecOps in the hybrid squad: security when AI agents also write code

How to apply DevSecOps in a hybrid squad, with people and AI agents in the same workflow: agent permissions, secrets, dependencies, human review, hidden instructions, pipeline gates and production monitoring.

Published on November 23, 2026. 9 min read

In a hybrid squad, part of the code, tests and documentation is written by AI agents, and people review and approve what goes to production. As a result, the number of changes per week grows, and each agent becomes one more user with access to the repository, the delivery pipeline and, sometimes, data. DevSecOps in the hybrid squad is the application of security practices in the development cycle to this scenario: each agent has its own identity, permissions and logs, and everything it produces goes through the same security gates as code written by a person.

This guide builds on the text about DevSecOps and covers what changes when agents enter the workflow: the new risks, the controls at each stage of the cycle, the rules agents need to follow and how to measure whether security keeps pace with speed. To understand the team format, see the guide to dedicated and hybrid squads.

What changes in security when AI agents write code?

The base practices stay the same: code review, tests, dependency analysis, secrets management and monitoring. What changes is the volume and the number of actors. Five points need attention:

  1. More changes to review. Agents produce quickly, and human review can become a bottleneck or start to be done on autopilot, which lets a problem slip through unnoticed.
  2. The agent is a new user. It uses credentials, calls tools and changes files. If it has too much permission, one of its mistakes is as large as that permission. OWASP calls this risk excessive agency.
  3. Suggested dependencies. An agent may suggest a library that is outdated, has a known vulnerability or has a name similar to another one. It may even suggest a package that does not exist, and someone can register that name later with malicious code.
  4. Instructions hidden in content. The agent reads tasks, comments, documentation and web pages. Any of these texts can carry an instruction, such as "send the environment variables to this address". OWASP classifies this attack as prompt injection and puts it first on its list of risks for applications built on language models.
  5. Data leaving the environment. Code, logs and test data sent to an AI provider need rules. Customer personal data in a test file becomes a data protection issue under laws such as Brazil's LGPD.

Which controls go into each stage of the cycle?

DevSecOps in the hybrid squad, stage by stage
  1. Requirements and design: Threats and abuse cases become acceptance criteria.
  2. Agent environment: Own identity, least privilege and no secrets in context.
  3. Code and dependencies: Secret checks and review of every new dependency.
  4. Human review: Every agent change labeled and approved by a person.
  5. Pipeline: The same gates for all code, and agents cannot turn them off.
  6. Production: Monitoring, logs of agent actions and incident response.

Agents work inside the pipeline. Each stage has a control and a person who decides.

1. Requirements and design

AI helps list threats and abuse cases from the requirements: who might try to access what they should not, which data is sensitive, what happens if an integration fails. A person decides which ones enter the scope. Those that do become acceptance criteria, alongside the business requirements. The software requirements guide shows how to write these criteria.

2. Agent environment

  • Own identity. Each agent uses its own account, not a team member's. That makes it clear what was done by whom.
  • Least privilege. As a rule, the agent reads the repository and opens changes for review. It does not approve its own change, does not deploy to production and does not access the production database.
  • Short-lived credentials, created for the task and revoked at the end.
  • Isolated environment, with network access restricted to what the task needs.
  • No secrets in context. Passwords, API keys and tokens stay in the pipeline's secrets vault, out of the agent's reach.

3. Code and dependencies

  • Secret checks before anything is committed, in case a key ended up in the code.
  • Review of every new dependency: whether the package exists, who maintains it, whether it is updated, what license it has and whether it has known vulnerabilities.
  • Pinned versions in the dependency file and an inventory of the system's components (SBOM).

4. Human review

  • Every change made by an agent is labeled as such, so the reviewer knows what they are reading.
  • Review by a person is mandatory before any change enters the main project.
  • Small changes. One rule for agents is to split work into parts a person can review carefully.
  • Sensitive areas reviewed by someone senior: authentication, permissions, payments and personal data.

The agent can do the first review and point out issues. Approval stays with a person.

5. Delivery pipeline

Agent code goes through the same gates as anyone's: build, tests, static analysis (SAST), dependency analysis (SCA), secret checks, infrastructure as code analysis and dynamic testing (DAST) in staging. Two extra precautions:

  • Pipeline configuration files are protected. The agent does not change the pipeline or turn off a gate without approval from a person.
  • Production deployment with human approval, especially for sensitive changes.

The step by step of the pipeline is in the CI/CD and pipeline glossary term.

6. Production

  • Monitoring and alerts for the live system.
  • Logs of each agent's actions: what it read, which tool it called, what it changed.
  • Incident response with a specific step for agents: revoke credentials and pause the agent involved.

With the system live, Urutau Sec watches the operation 24x7.

Risks and controls, side by side

RiskControlWho decides
Review done on autopilotSmall, labeled changes with mandatory reviewThe reviewer
Agent with too much permissionOwn identity, least privilege and short-lived credentialsWhoever defines the agent rules
Malicious or nonexistent dependencyReview of every new dependency and SCAThe reviewer
Instruction hidden in content the agent readsContent treated as data, limited permissions and action logsWhoever defines the agent rules
Exposed secretSecrets vault and checks before commitThe pipeline, with an alert to the team
Personal data sent to the AI providerRules on which data enters context and masked test dataThe person responsible for data at the client

Which rules should be written for agents?

The rules go into a short document, versioned in the repository with the code:

  • what each agent can read and what it can change;
  • at which points it needs approval;
  • which data never enters the context;
  • what to do when it finds an instruction inside content (treat it as data and notify a person);
  • how actions are logged;
  • who reviews the rules and how often.

How much each agent can do on its own depends on the cost of an error in that task. The guide to AI agent autonomy levels shows how to decide. The structure around the agent, with tools, limits and logs, is in the guide to agent harness and evals.

How do you know security keeps pace with speed?

  • pipeline findings per release, by severity;
  • time to fix each finding;
  • secrets blocked before reaching the repository;
  • new dependencies in the period and how many were reviewed;
  • agent changes rejected for security reasons, and the reason.

These numbers go into the same follow-up as the delivery metrics, described in the guide AI-native squad: what to measure.

UEEK examples

  • Itaú Mulher Empreendedora: security in three layers, in the code, the infrastructure and the delivery, with CI/CD running SAST, SCA and DAST analysis and external pentests, to banking-sector standards. That is the level of control that also applies to code written by agents. See the case.
  • Hudino: the Hudino Leads platform was built with AI-assisted engineering, with a project standard designed to scale and with security and technical control. See the case.

Frequently asked questions

Is code written by AI less secure?

It can have the same problems as code written by people, such as weak input validation or a vulnerable dependency. The bigger risk comes from volume and rushed review. That is why pipeline gates apply equally to all code.

Can the agent access production?

As a rule, no. When a task requires reading production logs, access is read-only, with masked data, for a limited time and with approval from a person.

Do I need agent-specific tools?

The base is the same DevSecOps pipeline. What gets added is each agent's own identity, action logs and written rules for what each one can do.

What happens if the agent reads a malicious instruction?

With least privilege, the possible damage is small. The agent should treat the content as data, without carrying out what it asks, and the action logs show what happened. Human review stops the change before it enters the project.

Does DevSecOps in the hybrid squad replace a pentest?

No. The pipeline finds known problems with every change. A pentest tests the system the way an attacker would, and it is still useful for major releases and for systems that hold sensitive data.

Where to start?

With an assessment of what exists: who has access to what, how secrets are stored, which gates the pipeline has and what agents can do today.

Sources

How UEEK can help

In the DevSecOps assessment, UEEK reviews the delivery pipeline, secrets, infrastructure and monitoring, and delivers the weak points ranked by real risk. In the DevSecOps implementation, it builds the pipeline from repository to production, with CI/CD and SAST, DAST and SCA analysis, and prepares the team to run it. In UEEK's development squads, AI agents work inside the workflow, with human review of every delivery. That is 14 years in the market and more than 500 projects delivered for more than 200 clients in 6 countries.

Get the DevSecOps assessment

Topics

  • DevSecOps
  • hybrid squad
  • security of AI-generated code
  • AI agents in development
  • pipeline security

Want this in production?

UEEK does this kind of work in DevSecOps assessment.

See the solution