Unknown Actions: The Hidden Risk in Enterprise AI Systems
Explore the risks of autonomous AI agents in enterprise systems and how to implement runtime security using Envoy, OPA, and OpenTelemetry.

Unknown Actions: The Hidden Risk in Enterprise AI Systems
As enterprises transition from "Chatbots" to Agentic AI, the security perimeter is shifting. In a traditional RAG (Retrieval-Augmented Generation) setup, the primary risk is data leakage via prompt injection. However, in an agentic world—where AI can invoke tools, call APIs, and modify databases—the risk is execution-based.
Gartner predicts that by 2026, over 80% of enterprises will have used generative AI APIs or models; however, without proper governance, the failure rate for these autonomous projects remains high. The real threat isn't just what the AI says, but what it does inside your trusted network.
Autonomous System Architecture & Challenges
Modern agentic systems are composed of three primary layers: the Orchestrator (the brain), Tools (the hands), and the Runtime (the environment).
In a typical enterprise workflow, an agent might receive a high-level goal, decompose it into a series of tool calls (e.g., "Check ERP inventory," "Update CRM status," "Email procurement"), and execute them. This requires complex identity propagation. We often see systems utilizing JWT (JSON Web Tokens) and JWKS to validate identity, but the challenge lies in Token Exchange. How does an agent acting on behalf of a user get the specific scoped credentials needed for a downstream SaaS API?
Most enterprises focus their security on the model (LLM) input/output. However, the orchestrator logic is often a "black box" where tool invocation happens without a centralized enforcement point. If the orchestrator is compromised or the agent "hallucinates" a tool parameter, there is no secondary layer to catch the unauthorized action before it hits the production database.

Autonomous System Risks
The shift from prediction to action introduces five core risk categories:
- Action Risk: Unauthorized API execution or privilege escalation where an agent performs a "DELETE" operation instead of a "GET."
- Data Risk: Exposure of PII through RAG pipelines or agents accessing cross-tenant data they shouldn't see.
- Financial Risk: "Looping" agents that consume excessive tokens or trigger high-cost API transactions repeatedly.
- Operational Risk: Agents triggering cascading failures in microservices by hitting rate limits or creating invalid state changes.
- Compliance Risk: The inability to produce a "Who, What, When" audit trail for an action taken by an AI agent.
Table 1: Autonomous System Risks vs. Business Impact
Risk Category | Technical Trigger | Business Impact |
Action | Tool parameter manipulation | Loss of data integrity / Unauthorized transactions |
Financial | Infinite retry loops in tool calls | Sudden, unbudgeted cloud/API expenses |
Compliance | Missing agent identity in logs | Failure of SOC2/HIPAA audits |
Operational | Simultaneous multi-agent DB writes | System downtime and race conditions |

Interoperability & Lock-In Risks
One of the greatest "hidden" risks is architectural lock-in. Many orchestrator frameworks use proprietary connectors and embedded policy logic. If your security rules are hardcoded into a specific Python framework, you cannot easily migrate to a different model or provider.
The Solution:
- Externalized Policy: Use Open Policy Agent (OPA) to keep logic outside the application code.
- Neutral Telemetry: Implement OpenTelemetry for vendor-agnostic observability.
- Standardized Identity: Use SPIFFE/Spire or standard OIDC for agent identity.
Runtime Control Architecture
To mitigate "Unknown Actions," enterprises must implement a Runtime AI Gateway. This pattern, aligned with emerging standards at Aegis Security, decouples the decision-making (AI) from the enforcement (Infrastructure).
Core Components:
- Gateway (Envoy Proxy): Intercepts all outgoing calls from agents to tools.
- ext_authz: The Envoy filter that offloads authorization to an external service.
- Policy Engine (OPA): Evaluates if the agent's requested action is permitted based on the current context.
Observability (OpenTelemetry): Captures the full trace of the agent's intent vs. the actual execution.

Governance & Control Model
A robust governance model treats an AI agent like a first-class identity.
- Identity: Every agent must have a verifiable identity (MTLS or JWT).
- Least Privilege: Agents should only access tools required for their specific task.
- Runtime Enforcement: Policies must be checked at the moment of execution, not just at the prompt level.
- Shadow Mode: New agent workflows should run in "dry-run" mode, where OPA evaluates the policy but doesn't block, allowing for baseline behavior analysis.
Table 2: Control Mechanisms vs. Risk Mitigation
Control Mechanism | Risk Mitigated | Implementation Detail |
Policy-as-Code (OPA) | Action Risk | Rego rules for API path/verb access |
Token Exchange | Data Risk | Scoped JWTs for tool execution |
Shadow Mode | Operational Risk | Validate agent logic before "Live" status |
Otel Tracing | Compliance Risk | End-to-end auditability of agent intent |
Enterprise Failure Scenarios: The Reality of "Over-Automation"
Consider a Large Financial Institution that deployed an agent to "streamline customer disputes."
- The Failure: The agent was given access to a refund tool. A customer used a prompt injection to convince the agent that a "partial discount" actually meant a "full reversal" of a $10,000 transaction.
- The Gap: There was no runtime gateway. The orchestrator trusted the LLM's output and called the API directly with admin credentials.
- The Lesson: If a Policy Enforcement Point (PEP) had been in place, a rule stating max_refund_amount: 500 would have blocked the action regardless of the agent's "intent."
Secure Control Plane Architecture
The control plane manages the distribution of policies to the various gateways. This ensures that a policy change (e.g., "Disable all agents from accessing the HR database") is propagated instantly across the enterprise.
Business Value: Control Enables Scale
It is a common misconception that security slows down innovation. In the context of Agentic AI, control enables scale. Without a runtime enforcement layer, security teams will inevitably block agentic projects due to the "blast radius" concern.
By implementing an architecture based on Envoy, OPA, and OpenTelemetry, organizations can:
- Reduce Blast Radius: Limit what a compromised or hallucinating agent can do.
- Improve Audit Readiness: Move from "vague logs" to "structured action traces."
- Ensure Vendor Flexibility: Avoid being locked into a single orchestrator's security model.
Technical Terms Glossary
- Policy-as-Code: Managing security rules through machine-readable definition files.
- ext_authz: An Envoy filter that enables external authorization checks.
- OPA Bundles: Compressed files containing Rego policies and data sent to OPA agents.
- JWT & JWKS: Standards for secure identity representation and verification.
- Runtime Enforcement: The practice of checking security policies at the exact moment an action is attempted.
The future of AI in the enterprise isn't just about smarter models; it’s about safer execution. For teams building these systems, the mandate is clear: Never trust an agent's intent—always verify its actions.
Conclusion: The Architecture of Trust
The promise of Agentic AI lies in its ability to operate autonomously, but in a regulated enterprise, autonomy without accountability is a liability. As we have explored, the primary risk has shifted from the "Model" to the "Execution Layer." By decoupling policy enforcement from the orchestration logic—utilizing a Runtime Gateway with Envoy, OPA, and OpenTelemetry—organizations can build a "Zero Trust" framework for AI agents.
This architecture doesn't just mitigate risk; it provides the structural integrity required to move AI projects from experimental sandboxes into core production systems. By treating every agent action as a formal request that must be authenticated, authorized, and audited, CISOs can confidently enable the business to scale automation. The real risk is not the AI itself, but the lack of a control plane to govern its actions within your trusted systems. For those ready to implement these guardrails, the path forward is clear: Secure the execution, and the intelligence will follow.
Frequently Asked Questions (FAQ)
Q1: Why can’t I just use prompt engineering to secure my agents? A: Prompt engineering (or "System Prompts") is a soft control. It is susceptible to prompt injection and model hallucinations. For enterprise-grade security, you need hard controls—Runtime Enforcement—that reside outside the LLM’s influence and can block unauthorized API calls regardless of what the model "intended" to do.
Q2: How does a Runtime Gateway impact system latency? A: When using a high-performance proxy like Envoy with a local OPA sidecar, the latency overhead is typically sub-millisecond. For most agentic workflows, which already involve LLM inference times of 500ms to 2s, this infrastructure overhead is negligible and a necessary trade-off for security.
Q3: Can I use existing IAM roles instead of a new Policy Engine? A: Standard IAM is often too coarse-grained for agentic workflows. While IAM can control if an agent can call an API, Policy-as-Code (OPA) allows you to inspect the payload of the call (e.g., "Allow this agent to update CRM records, but only for customers in the 'Tier 1' category and only for amounts under $5,000").
Q4: What is the role of OpenTelemetry in AI security? A: OpenTelemetry provides the "flight recorder" for your agents. It allows you to trace a high-level user request down through the orchestrator and into specific tool executions. This is vital for "Root Cause Analysis" when an agent takes an unexpected action and for maintaining compliance audit trails.
Q5: What is "Shadow Mode" and why is it recommended? A: Shadow mode allows you to deploy new security policies in a "dry-run" state. The gateway evaluates the agent's actions against the OPA policy and logs whether it would have been blocked without actually stopping the transaction. This helps fine-tune policies and prevents breaking critical business workflows during initial deployment.