Artificial intelligence is becoming part of the software development lifecycle at a much deeper level. Developers are no longer using AI only to generate code or answer technical questions. Increasingly, AI agents can break a larger task into subtasks, use tools, make decisions within defined boundaries, and execute those steps with limited human intervention.

Advertisment

That changes the security equation, according to Naresh Agarwal, SVP, Engineering, India, at Harness. Once an agent can take action inside a software environment, it can no longer be treated as just a code generator. It has to be seen as an identifiable, controlled actor. The question is no longer simply whether the generated code is correct, but which agent performed the action, what permissions it had, what tools it used, and whether it was actually authorized to do so.

Giving AI agents an identity

Traditional software environments already have established mechanisms for managing human identities and service accounts. Agentic systems add another layer to that model. Each agent needs an identity and a defined role. Its permissions should be linked to that role, with onboarding and offboarding processes similar to those used for human users.

Least-privilege access becomes particularly important here. An agent could operate with read access by default and receive write privileges only when a specific workflow requires them. That elevated privilege could remain valid for a short period and then be revoked automatically.

Advertisment

Sandboxing adds another control layer. Instead of allowing an agent to interact directly with sensitive production systems or data, organizations can place it inside a controlled execution environment with restricted access.

The idea is simple but important. An agent should have enough privilege to complete its task, but nothing more.

Cryptographic provenance can create an evidence trail

Identity and access controls answer one part of the security problem. Organizations also need visibility into what an agent actually did.

Advertisment

That makes telemetry, logging, and provenance increasingly important. Every agent action can be recorded along with information about the identity of the agent, the prompt, the context, the skills or tools used, the environment, and the timestamp.

The resulting record can help reconstruct a multi-step agent workflow. It can also provide an audit trail if something goes wrong.

Cryptographic protection adds another layer of trust to this evidence. Provenance records can be stored in an evidence vault so that organizations have a protected record of actions performed across the software development lifecycle.

Advertisment

This becomes particularly relevant when multiple foundation models can sit behind an agent. An agent may use different models depending on the task. Recording that model information alongside the action provides additional context for security investigations, compliance reviews, and troubleshooting.

Production access needs independent controls

One of the biggest questions around agentic software development is what happens when an AI system can generate, validate, and potentially authorize its own code. The safer model is to separate these responsibilities. Generated code should pass through defined guardrails before it reaches production.

Human code review remains one option. An engineer can examine an AI-generated change and explicitly approve it before deployment.

Advertisment

Another approach is agent-to-agent review. One agent can generate the code while a specialized code review agent evaluates it. The review agent can examine the repository, architecture, application programming interfaces, and historical code review data to understand the context around the change.

The process can then become iterative. The review agent identifies an issue, the generating agent addresses it, and the review agent checks the revised code.

That does not remove the need for people. High-risk changes can still be routed to engineers for explicit review. The result is a tiered model in which routine changes can move through automated controls while higher-risk changes receive additional human scrutiny.

Advertisment

AI security has to cover development and runtime

The security challenge does not end once AI-generated code is written. Vulnerabilities can enter during development and can also emerge when AI applications are running in production.

A shift-left security approach brings security checks closer to code generation. AI-generated code, prompts, and skills can be scanned for vulnerabilities before changes move further through the software development lifecycle. Runtime security addresses a different set of risks. Organizations need visibility into the AI APIs being used, the data flowing through them, and the security posture of those interfaces.

Prompt injection is one example. A malicious or carefully crafted prompt can attempt to manipulate an AI system into taking an unintended action or exposing sensitive information. Runtime controls can detect and block such activity during an API call.

Advertisment

The deployment architecture also needs to fit the organization's security requirements. The interview discussed cloud, bring-your-own-cloud, and on-premises deployment models as possible approaches.

Human oversight still has a role

AI agents are becoming more capable, but reliability remains a concern. Hallucinations can produce incorrect or unexpected results, even as newer models improve on complex tasks. The practical response is not to stop automation. It is to put controls around it.

Guardrails can constrain what an agent is allowed to do, while AI evaluations can test whether an agent behaves as expected. These evaluations effectively act as a testing layer for AI applications and agentic workflows.

The combination matters because an agent can be technically capable of completing a task without necessarily producing the right outcome every time. Testing can identify problematic behavior before an output reaches an end user, while policy controls can determine when human approval is mandatory.

This points to a broader shift in software security. As agents become active participants in the development lifecycle, identity, authorization, telemetry, provenance, runtime protection, and evaluation will increasingly need to work together.

The code may still be the final artifact, but the trail behind that code is becoming just as important. Organizations will need to know which agent acted, what it was allowed to access, what it actually did, and where a human stepped in.

More For You

AI can write code faster. Can enterprises secure it 

The 5 Windows commands that reveal where your internet broke 

AI-generated code is changing Microsoft’s zero trust strategy 

Google rebuilds Chrome security around AI agents and faster patches