Live
Edge AI Replication Threat: Small Open‑Weight Models Can Self‑Deploy Across Cheap DevicesGitHub Actions lockfiles now in public preview – practical impact for CI pipelinesCloudflare WAF adds block rule for Remote Code Execution attacksPreparing Cloud Workloads for Post‑Quantum Cryptography with Google’s Gemini NotebookDiagnosing Intermittent Latency in Healthy Kubernetes ClustersBigQuery AI Token Quotas: Enforcing Predictable Generative AI SpendAI‑driven cloud remediation on Amazon Bedrock: architecture and operational insightsAutomating PowerPoint Creation with Amazon Bedrock AgentCore and RAG PipelinesEdge AI Replication Threat: Small Open‑Weight Models Can Self‑Deploy Across Cheap DevicesGitHub Actions lockfiles now in public preview – practical impact for CI pipelinesCloudflare WAF adds block rule for Remote Code Execution attacksPreparing Cloud Workloads for Post‑Quantum Cryptography with Google’s Gemini NotebookDiagnosing Intermittent Latency in Healthy Kubernetes ClustersBigQuery AI Token Quotas: Enforcing Predictable Generative AI SpendAI‑driven cloud remediation on Amazon Bedrock: architecture and operational insightsAutomating PowerPoint Creation with Amazon Bedrock AgentCore and RAG Pipelines
AWS

Natural Language Query Engine Slashes Orca Security Query Costs on Amazon Bedrock

AI SummaryPowered by AI

Orca Security replaced a monolithic prompt‑based LLM approach with a nine‑stage Retrieval‑Augmented Generation pipeline on Amazon Bedrock, cutting input tokens by 93% and latency by 75%. This redesign delivers faster, cheaper, and more accurate cloud‑infrastructure queries for engineers and security teams.

Orca Security moved from a single‑prompt model that consumed millions of tokens per request to a modular Discovery AI pipeline built on Amazon Bedrock. The change reduces token usage, execution time, and cost while improving the reliability of generated Sonar queries, directly impacting anyone who builds or operates cloud security tooling.

Why Engineers Should Care

For cloud, platform, DevOps, and security engineers, query latency and cost are operational constraints. The original design required roughly 2 million input tokens per workload and 60 seconds of latency, making large‑scale adoption impractical. After the redesign, Orca reports a 90 % reduction in query‑related cost, a 93 % drop in input tokens, and a 75 % cut in response time, enabling thousands of queries per day with sub‑15‑second turnaround. Faster feedback loops improve incident response, compliance checks, and automated remediation pipelines.

Discovery AI Architecture at a Glance

The new system follows a nine‑stage flow, each matched to the most suitable Bedrock model:

  1. Request Entry and Context Setup – Combines the user’s natural language with tenant metadata (cloud providers, organization ID) to give the model situational awareness.
  2. Quick Deterministic Matcher – Uses regex and rule‑based logic to spot high‑confidence identifiers (IP, CVE, ARN, hash, etc.). When a match is found, a pre‑built Discovery filter is returned without invoking an LLM.
  3. LLM Guardrail Screening – Validates that the request is safe, relevant, and supported, rejecting prompt‑injection or off‑topic inputs before further processing.
  4. Retrieval Augmented Generation (RAG) Step – Retrieves relevant portions of the 900+ Sonar schema from a vector store, limiting the prompt size and focusing the model on needed definitions.
  5. Schema‑Aware Prompt Construction – Crafts a concise prompt that includes only the retrieved schema fragments and the user query.
  6. LLM Generation – Generates a candidate Sonar JSON filter using the selected foundation model.
  7. Syntax Validation – Checks the JSON against the Sonar schema to catch structural errors early.
  8. Semantic Verification – Runs a second LLM pass to ensure the filter matches the original intent, flagging mismatches for refinement.
  9. Final Dispatch – Sends the validated filter to Orca’s Sonar engine for execution.

Amazon Bedrock’s unified API lets Orca swap foundation models per stage without rewriting integration code, and the service inherits AWS IAM, VPC endpoints, and CloudTrail for auditability.

Operational and Security Implications

Adopting a multi‑stage pipeline introduces new operational considerations:

  • Model Management – Teams must track which model version powers each stage and plan upgrades without breaking downstream validation.
  • Vector Store Governance – The RAG component relies on a searchable embedding store; access controls and data residency policies must be enforced.
  • Guardrail Effectiveness – The LLM screening step is the first line of defense against malicious prompts; its rules need regular review as threat patterns evolve.
  • Observability – Bedrock integrates with CloudTrail, but additional logging around each pipeline stage (e.g., matcher hits, validation failures) is advisable for debugging and compliance.

Because the pipeline returns a pre‑built filter for deterministic matches, the system can bypass LLM inference entirely for common identifiers, further reducing exposure to model‑related risks.

Related CloudNinjas coverage: AWS.

What This Means For Practitioners

Teams building cloud‑security query interfaces should consider a hybrid RAG architecture rather than a monolithic prompt. By separating deterministic pattern matching, guardrails, and schema‑aware generation, you can achieve measurable cost and latency improvements while retaining flexibility to evolve the underlying models. Evaluate your own query schema for opportunities to externalize large definitions into a retrieval layer, and implement early‑stage validation to keep LLM usage focused and auditable.

Originally published atAWS Machine Learning Blog