Building AI apps and agents for Microsoft Marketplace requires security to be designed in from day one—so they’re easier to publish, review, and scale on Microsoft Marketplace. You’ll learn how clear trust boundaries, identity controls, and guardrails reduce risk, speed Marketplace readiness, and build customer trust.
Why security must be designed in—not validated later
AI apps and agents expand the security surface beyond that of traditional applications. Prompt inputs, agent reasoning, tool execution, and downstream integrations introduce opportunities for misuse or unintended behavior when security assumptions are implicit. These risks surface quickly in production environments where AI systems interact with real users and data.
Deferring security decisions until late in the lifecycle often exposes architectural limitations that restrict where controls can be enforced. Retrofitting security after deployment is costly and can force tradeoffs that affect reliability, performance, or customer trust.
Designing security early establishes clear boundaries, enables consistent enforcement, and reduces friction during Marketplace review, onboarding, and long‑term operation. In the Marketplace context, security is a foundational requirement for trust and scale.
This post is part of a series on building and publishing well-architected AI apps and Agents on Microsoft Marketplace.
How AI apps and agents expand the attack surface
Without a clear view of where trust boundaries exist and how behavior propagates across systems, security controls risk being applied too narrowly or too late.
AI apps and agents introduce security risks that extend beyond those of traditional applications. AI systems accept open‑ended prompts, reason dynamically, and often act autonomously across systems and data sources.
These interaction patterns expand the attack surface in several important ways:
- New trust boundaries introduced by prompts and inputs, where unstructured user input can influence reasoning and downstream actions
- Autonomous behavior, which increases the blast radius when authentication or authorization gaps exist
- Tool and integration execution, where agents interact with external APIs, plugins, and services across security domains
- Dynamic model responses, which can unintentionally expose sensitive data or amplify errors if guardrails are incomplete
Each API, plugin, or external dependency becomes a security choke point where identity validation, audit logging, and data handling must be enforced consistently—especially when AI systems span tenants, subscriptions, or ownership boundaries.
Using OWASP GenAI Top 10 as a threat lens
The OWASP GenAI Top 10 provides a practical, industry‑recognized lens for identifying and categorizing AI‑specific security threats that extend beyond traditional application risks. Rather than serving as a checklist, the OWASP GenAI Top 10 helps teams ask the right questions early in the design process. It highlights where assumptions about trust, input handling, autonomy, and data access can break down in AI‑driven systems—often in ways that are difficult to detect after deployment.
Common risk categories highlighted by OWASP include:
- Prompt injection and manipulation, where malicious input influences agent behavior or downstream actions
- Sensitive data exposure, including leakage through prompts, responses, logs, or tool outputs
- Excessive agency, where agents are granted broader permissions or action scope than intended
- Insecure integrations, where tools, plugins, or external systems become unintended attack paths
Highly regulated industries, sensitive data domains, or mission‑critical workloads may require additional risk assessment and security considerations that extend beyond the OWASP categories.
The OWASP GenAI Top 10 allows teams to connect high‑level risks to architectural decisions by creating a shared vocabulary that sets the foundation for designing guardrails that are enforceable both at design time and at runtime.
Designing security guardrails into the architecture
Security guardrails must be designed into the architecture, shaping where and how policies are enforced, evaluated, and monitored throughout the solution lifecycle.
Guardrails operate at two complementary layers:
- Design time, where architectural decisions determine what is possible, permitted, or blocked by default
- Runtime, where controls actively govern behavior as the AI app or agent interacts with users, data, and systems
When architectural boundaries are not defined early, teams often discover that critical controls—such as input validation, authorization checks, or action constraints—cannot be applied consistently without redesign:
- Tenancy boundaries, defining how isolation is enforced between customers, environments, or subscriptions
- Identity boundaries, governing how users, agents, and services authenticate and what actions they can perform
- Environment separation, limiting the blast radius of experimentation, updates, or failures
- Control planes, where configuration, policy, and behavior can be adjusted without redeploying core logic
- Data planes, controlling how data is accessed, processed, and moved across trust boundaries
Designing security guardrails into the architecture transforms security from reactive to preventative, while also reducing friction later in the Marketplace journey. Clear enforcement boundaries simplify review, clarify risk ownership, and enable AI apps and agents to evolve safely as capabilities and integrations expand.
Identity as a security boundary for AI apps and agents
Identity defines who can access the system, what actions can be taken, and which resources an AI app or agent is permitted to interact with across tenants, subscriptions, and environments. Agents often act on behalf of users, invoke tools, and access downstream systems autonomously. Without clear identity boundaries, these actions can unintentionally bypass least‑privilege controls or expand access beyond what users or customers expect.
Strong identity design shapes security in several key ways:
- Authentication and authorization, determines how users, agents, and services establish trust and what operations they are allowed to perform
- Delegated access, constraints agents to act with permissions tied to user intent and context
- Service‑to‑service trust, ensures that all interactions between components are explicitly authenticated and authorized
- Auditability, traces actions taken by agents back to identities, roles, and decisions
A zero-trust approach is essential in this context. Every request—whether initiated by a user, an agent, or a backend service—should be treated as untrusted until proven otherwise. Identity becomes the primary control plane for enforcing least privilege, limiting blast radius, and reducing downstream integration risk. This foundation not only improves security posture, but also supports compliance, simplifies Marketplace review, and enables AI apps and agents to scale safely as integrations and capabilities evolve.
Protecting data across boundaries
Data may reside in customer‑owned tenants, subscriptions, or external systems, while the AI app or agent runs in a publisher‑managed environment or a separate customer environment. Protecting data across boundaries requires teams to reason about more than storage location. Several factors shape the security posture:
- Data ownership, including whether data is owned and controlled by the customer, the publisher, or a third party
- Boundary crossings, such as cross‑tenant, cross‑subscription, or cross‑environment access patterns
- Data sensitivity, particularly for regulated, proprietary, or personally identifiable information
- Access duration and scope, ensuring data access is limited to the minimum required context and time
When these factors are implicit, AI systems can unintentionally broaden access through prompts, retrieval‑augmented generation, or agent‑initiated actions. This risk increases when agents autonomously select data sources or chain actions across multiple systems.
To mitigate these risks, access patterns must be explicit, auditable, and revocable. Data access should be treated as a continuous security decision, evaluated on every interaction rather than trusted by default once a connection exists. This approach aligns with zero-trust principles, where no data access is implicitly trusted and every request is validated based on identity, context, and intent.
Runtime protections and monitoring
For AI apps and agents, security does not end at deployment. In customer environments, these systems interact continuously with users, data, and external services, making runtime visibility and control essential to a strong security posture. AI behavior is also dynamic: the same prompt, context, or integration can produce different outcomes over time as models, data sources, and agent logic evolve, so monitoring must extend beyond infrastructure health to include behavioral signals that indicate misuse, drift, or unintended actions.
Effective runtime protections focus on five core capabilities:
- Vulnerability management, including regular scanning of the full solution to identify missing patches, insecure interfaces, and exposure points
- Observability, so agent decisions, actions, and outcomes can be traced and understood in production
- Behavioral monitoring, to detect abnormal patterns such as unexpected tool usage, unusual access paths, or excessive action frequency
- Containment and response, enabling rapid intervention when risky or unauthorized behavior is detected
- Forensics readiness, ensuring system-state replicability and chain-of-custody are retained to investigate what happened, why it happened, and what was impacted
Monitoring that only tracks availability or performance is insufficient. Runtime signals must provide enough context to explain not just what happened, but why an AI app or agent behaved the way it did, and which identities, data sources, or integrations were involved. Equally important is integration with broader security event and incident management workflows. Runtime insights should flow into existing security operations so AI-related incidents can be triaged, investigated, and resolved alongside other enterprise security events—otherwise AI solutions risk becoming blind spots in a customer’s operating environment.
Preparing for incidents and abuse scenarios
No AI app or agent operates in a perfectly controlled environment. Once deployed, these systems are exposed to real users, unpredictable inputs, evolving data, and changing integrations. Preparing for incidents and abuse scenarios is therefore a core security requirement, not a contingency plan.
AI apps and agents introduce unique incident patterns compared to traditional software. In addition to infrastructure failures, teams must be prepared for prompt abuse, unintended agent actions, data exposure, and misuse of delegated access. Because agents may act autonomously or continuously, incidents can propagate quickly if safeguards and response paths are unclear.
Effective incident readiness starts with acknowledging that:
- Abuse is not always malicious, misuse can stem from ambiguous prompts, unexpected context, or misunderstood capabilities
- Agent autonomy may increase impact, especially when actions span multiple systems or data sources
- Security incidents may be behavioral, not just technical, requiring interpretation of intent and outcomes
Preparing for these scenarios requires clearly defined response strategies that account for how AI systems behave in production. AI solutions should be designed to support pause, constrain, or revoke agent capabilities when risk is detected, and to do so without destabilizing the broader system or customer environment.
Incident response must also align with customer expectations and regulatory obligations. Customers need confidence that AI‑related issues will be handled transparently, proportionately, and in accordance with applicable security and privacy standards. Clear boundaries around responsibility, communication, and remediation help preserve trust when issues arise.
How security decisions shape Marketplace readiness
From initial review to customer adoption and long‑term operation, security posture is a visible and consequential signal of readiness. AI apps and agents with clear boundaries—around identity, data access, autonomy, and runtime behavior—are easier to evaluate, onboard, and trust. When security assumptions are explicit, Marketplace review becomes more predictable, customer expectations are clearer, and operational risk is reduced.
Ambiguous trust boundaries, implicit data access, or uncontrolled agent actions can introduce friction during review, delay onboarding, or undermine customer confidence after deployment.
Marketplace‑ready security is therefore not about meeting a minimum bar. It is about enabling scale. Well-designed security allows AI apps and agents to integrate into enterprise environments, align with customer governance models, and evolve safely as capabilities expand. When security is treated as a first‑class architectural concern, it becomes an enabler rather than a blocker—supporting faster time to market, stronger customer trust, and sustainable growth through Microsoft Marketplace.
What’s next in the journey
Security for AI apps and agents is not a one‑time decision, but an ongoing design discipline that evolves as systems, data, and customer expectations change. By establishing clear boundaries, embedding guardrails into the architecture, and preparing for real‑world operation, publishers create a foundation that supports safe iteration, predictable behavior, and long‑term trust. This mindset enables AI apps and agents to scale confidently within enterprise environments while meeting the expectations of customers adopting solutions through Microsoft Marketplace.
Key resources
See curated, step-by-step guidance to help you build, publish, or sell your app or agent (no matter where you start) in App Advisor,
Quick-Start Development Toolkit
Microsoft AI Envisioning Day Events
How to build and publish AI apps and agents for Microsoft Marketplace