Skip to main content

Securing AI Agents at Runtime: Microsoft Agent 365

How Microsoft Agent 365 approaches real-time threat detection and runtime protection and what enterprises need to secure autonomous AI agents.

Updated 10 min readMarkdown

What Microsoft Agent 365 Teaches Us About Real-Time AI Security

Why securing AI agents requires more than pre-deployment testing: runtime threat detection, inline protection, tool security, and continuous governance.

AI agents are moving beyond conversational interfaces. They can access enterprise data, invoke tools, execute workflows, communicate with external services, and perform actions on behalf of users.

This creates a security challenge that traditional application security controls do not fully address.

An AI agent may pass security testing during development and still behave unexpectedly when exposed to untrusted content, malicious instructions, compromised tools, or sensitive enterprise resources.

The question is no longer simply whether an AI agent is secure before deployment.

It is whether an organization can understand, monitor, and control what that agent does while it is operating.

Microsoft's announcement of runtime threat detection and real-time protection capabilities for Microsoft Agent 365 illustrates an important shift in enterprise AI security: moving from static assurance toward continuous runtime protection.

1. Why AI Agent Security Must Extend to Runtime

Traditional software security generally focuses on predictable execution paths, defined permissions, application vulnerabilities, and known system interactions.

AI agents introduce additional complexity.

Their behavior can depend on:

  • Natural-language instructions.
  • External documents and retrieved content.
  • Model-generated decisions.
  • Tool and API responses.
  • Dynamic execution paths.
  • Delegated identities and permissions.
  • Interactions with other agents and services.

An agent might receive a seemingly legitimate request, retrieve information from an external source, interpret malicious instructions embedded in that content, and subsequently invoke a tool in an unintended way.

This is particularly relevant when agents have access to email, business applications, cloud infrastructure, customer information, or internal knowledge repositories.

A secure architecture must therefore address the complete agent execution lifecycle, not just the model or application itself.

2. What Microsoft Is Introducing with Agent 365

Microsoft has announced two complementary security capabilities within Security for AI in Microsoft Defender.

Threat Detection for Microsoft Agent 365 Agents

This capability is available in public preview.

It provides security teams with visibility into suspicious and potentially malicious activity involving supported AI agents.

According to Microsoft, detection analyzes runtime signals across agent interactions, tool usage, and execution patterns.

Supported cloud agent types include:

  • Microsoft Copilot Studio.
  • Microsoft Foundry.
  • Microsoft 365 Copilot Agent Builder.
  • Agents integrated through the Microsoft Agent 365 SDK.

These agents must emit observability logs to Microsoft Agent 365.

Microsoft identifies several categories of AI-specific threats:

Indirect prompt injection (XPIA)

Malicious instructions embedded in external content intended to manipulate an agent's behavior.

Evasion techniques

Attempts to bypass agent instructions, security policies, or established guardrails.

Malicious content propagation

Attempts to use agents to generate or distribute malicious content.

Secret leakage

Exposure of credentials, API keys, or other sensitive information through agent interactions.

LLM reconnaissance

Attempts to discover agent capabilities, instructions, or security boundaries.

Suspicious IP access

Agent access originating from anonymized or suspicious IP addresses.

Alerts are surfaced through Microsoft Defender, allowing SOC analysts to investigate using familiar security workflows, Advanced Hunting queries, and Defender XDR investigation capabilities.

Real-Time Protection for WorkIQ and Custom MCP Servers

The second capability is particularly relevant to organizations connecting agents to external tools.

Microsoft has made real-time protection generally available for WorkIQ and custom MCP servers.

Unlike detection, which identifies suspicious behavior and generates alerts, runtime protection can evaluate interactions and block threats inline.

When an agent invokes a registered tool or receives a tool response, Microsoft Defender evaluates that interaction against configured security policies.

The interaction can then be allowed or blocked directly within the agent execution flow.

Microsoft identifies several protected threat categories:

  • Evasion techniques.
  • Malicious content propagation.
  • Secret leakage.
  • Communication with untrusted domains.

This is an important architectural distinction: security controls are no longer limited to reviewing activity after execution. They can intervene during the interaction itself.

3. Detection and Prevention Are Different Security Functions

Organizations should not treat threat detection and runtime protection as interchangeable capabilities.

They solve different problems.

Security function Primary purpose
Runtime threat detection Identify suspicious activity
Inline runtime protection Block prohibited interactions
Security investigation Understand what happened
Incident response Contain and remediate threats
Governance Define acceptable agent behavior

Consider an agent that attempts to send sensitive information to an untrusted external domain.

A detection mechanism may identify the suspicious behavior and generate an alert.

An inline protection mechanism may prevent the interaction before the data leaves the controlled environment.

Both capabilities are valuable, but neither replaces the need for a broader security architecture.

Organizations still need identity controls, data protection, secure configuration, incident response procedures, and accountable ownership.

4. Five Security Areas Organizations Should Evaluate

Microsoft's announcement provides a useful starting point for a broader enterprise security assessment.

4.1 Agent Identity and Access Management

Every agent should have a clearly defined identity and ownership structure.

Organizations should establish:

  • Unique identities for agents where supported.
  • Least-privilege permissions.
  • Explicit authorization for sensitive operations.
  • Periodic access reviews.
  • Credential lifecycle management.
  • Revocation procedures when an agent is retired or compromised.

An agent should never inherit unrestricted access simply because its owner has elevated permissions.

4.2 Tool and MCP Server Security

MCP servers and other integrated tools expand an agent's attack surface.

Before registering a tool, organizations should evaluate:

  • Who operates the server?
  • What information can it access?
  • What operations can it perform?
  • What permissions does it require?
  • How are authentication credentials managed?
  • Can its responses contain untrusted instructions?
  • How are changes to tool definitions reviewed?

Tool registration should be treated as a security decision, not merely an integration task.

4.3 Sensitive Data Protection

Agents frequently interact with information that may include personal data, confidential business information, customer records, or intellectual property.

Organizations should establish controls for:

  • Data classification.
  • Access restrictions.
  • Data loss prevention.
  • Secret management.
  • Sensitive information exposure.
  • Retention and auditability.

The security objective is not simply to prevent unauthorized access to an agent.

It is also to prevent an authorized agent from using legitimate access in an unintended or excessive way.

4.4 Runtime Monitoring and Incident Response

AI agent activity should generate sufficient telemetry to support investigation.

Security teams should be able to understand:

  • Which agent performed an action.
  • Which identity it used.
  • Which tools it invoked.
  • What resources it accessed.
  • Whether a policy violation occurred.
  • Whether an interaction was blocked.
  • What happened before and after the event.

Incident response procedures should explicitly include AI agent scenarios.

For example, organizations should define when to disable an agent, revoke its credentials, block a tool, isolate an execution environment, or initiate a security investigation.

4.5 Governance and Accountability

Technical controls are necessary, but they do not establish organizational accountability by themselves.

Each production agent should have:

  • A documented business purpose.
  • An assigned owner.
  • An approved risk classification.
  • Defined operating boundaries.
  • Documented permissions.
  • Appropriate testing and approval.
  • Monitoring requirements.
  • Periodic reassessment.
  • A retirement or decommissioning procedure.

This connects runtime security with an effective AI governance framework.

5. A Practical AI Agent Runtime Security Checklist

Before approving an AI agent for production, security and engineering teams should evaluate the following controls.

Identity and permissions

  • Agent ownership is documented.
  • Identity and authentication mechanisms are defined.
  • Least-privilege permissions are enforced.
  • Sensitive operations require appropriate authorization.
  • Credentials can be revoked and rotated.

Tools and integrations

  • Connected tools and MCP servers are inventoried.
  • Tool permissions are explicitly reviewed.
  • Untrusted tool inputs and responses are evaluated.
  • External destinations are controlled.
  • Changes to integrations are subject to review.

Runtime security

  • Agent activity generates appropriate telemetry.
  • Suspicious behavior can be detected.
  • Relevant interactions can be blocked.
  • Prompt injection scenarios are tested.
  • Secret leakage scenarios are evaluated.
  • Incident response procedures cover agent compromise.

Governance

  • Business purpose and risk classification are documented.
  • A responsible owner is assigned.
  • Human oversight requirements are established.
  • Security exceptions are formally approved.
  • Periodic reviews are scheduled.
  • Decommissioning procedures are defined.

Not every organization will implement these controls using the same technology. The appropriate implementation depends on the agent architecture, its autonomy, its access to enterprise resources, and the organization's risk profile.

6. Connecting Runtime Security with ISO 42001 and ISO 27001

Runtime protection should not operate independently of the organization's existing governance and information security management systems.

ISO/IEC 42001 provides a framework for establishing and continually improving an Artificial Intelligence Management System (AIMS).

ISO/IEC 27001 provides a framework for managing information security risks through an Information Security Management System (ISMS).

These standards address different but complementary management objectives.

For organizations deploying AI agents, practical integration can include:

AI governance

  • AI system inventory.
  • Defined responsibilities.
  • AI risk assessment.
  • Human oversight.
  • Lifecycle management.
  • Monitoring and continual improvement.

Information security

  • Access control.
  • Supplier security.
  • Incident management.
  • Logging and monitoring.
  • Information protection.
  • Business continuity.

The important point is that deploying a runtime security product does not automatically establish compliance with either standard.

Organizations must demonstrate that their controls are appropriate, implemented, monitored, and supported by evidence.

7. The Next Challenge: Governing Autonomous Actions

Runtime protection represents an important step, but it does not eliminate the broader challenges associated with autonomous AI systems.

As agents gain access to more tools, data sources, and business processes, organizations must answer a more fundamental question:

Who is accountable when an AI agent performs an action that is technically authorized but operationally inappropriate?

This is where security engineering and AI governance must work together.

A mature approach should combine:

  1. Agent discovery and inventory.
  2. Identity and access governance.
  3. Risk-based authorization.
  4. Runtime monitoring and protection.
  5. Security incident response.
  6. Auditability and accountability.
  7. Continuous risk reassessment.

The objective is not to prevent organizations from adopting AI agents.

It is to ensure that their autonomy remains within explicitly defined and enforceable boundaries.

Conclusion: Secure AI Agents Throughout Their Lifecycle

Microsoft Agent 365 demonstrates how enterprise AI security is evolving beyond traditional pre-deployment controls.

Runtime threat detection provides visibility into suspicious agent activity, while inline protection introduces the ability to block selected malicious interactions during execution.

Together, these capabilities illustrate an important principle:

An AI agent should not be considered secure simply because it was approved for production. Its behavior must remain observable, controlled, and accountable throughout its operational lifecycle.

For security leaders, architects, and GRC professionals, the challenge is to connect technical runtime controls with identity management, data protection, incident response, and organizational governance.

That is what makes secure AI adoption sustainable.


About SpectraSec

SpectraSec focuses on cybersecurity, information security governance, risk management, regulatory compliance, and AI governance.

We help organizations translate security and governance requirements into practical controls, measurable processes, and operational security capabilities.

Website: https://spectrasec.eu

Further reading

Microsoft Community Hub: Securing AI Agents at Runtime: Real-Time Protection and Threat Securing AI Agents at Runtime: What Microsoft Agent 365 Teaches Us About Real-Time AI Security

About the author

  • I'm a Cybersecurity and GRC Strategist, Founder of SpectraSec, focused on information security, regulatory compliance, risk management, and AI governance. My work focuses on helping organizations build secure, resilient, and compliant digital environments through practical security strategies, governance frameworks, and technology-driven solutions. Core Areas of Expertise - Cybersecurity & Information Security - ISO/IEC 27001, SOC 2, NIS2, ENS & DORA - AI Governance & ISO/IEC 42001 - Risk Management & Regulatory Compliance - Cloud Security & Security Assessments - Privacy & Data Protection AI Engineering & Development Currently expanding my technical capabilities in AI Engineering, developing projects involving Python, LLMs, AI-powered applications, automation, data analytics, and intelligent workflows. I believe security, governance, and engineering must work together to build technology that organizations can trust. Areas of Interest: Cybersecurity | Artificial Intelligence | AI Governance | Automation | Cloud Architecture | Digital Trust Building secure technology. Enabling responsible AI. Turning complexity into practical solutions.

No comments yet. Be the first to comment.