What Happened
Enterprise AI teams are hitting two production realities at the same time: LLM usage is becoming expensive at scale, and AI platform integrations are creating new security and operational failure modes.
A report on enterprise AI spending described companies scrambling to reduce token consumption. One notable point was that non-engineers, not engineers, were driving much of the token usage. A specific example was PDF processing workflows that convert documents into images and then into Markdown, which was called a major token consumer [4].
Separately, OpenAI presented a timeline of an accidental security incident involving Hugging Face at Black Hat. The important lesson for enterprise AI teams is not the branding of the companies involved, but the operational pattern: AI systems increasingly interact with third-party platforms, model hubs, datasets, credentials and automation pipelines, so mistakes can become real security events [2].
At the application layer, coding agents continue to show impressive one-shot generation capabilities, including creating working games from short prompts [3][5]. That accelerates prototyping, but it does not remove the need for production engineering: identity, data boundaries, testing, observability, deployment controls, rollback and cost governance still have to be designed deliberately.
Why It Matters to Businesses
The AI infrastructure problem is shifting from “Can we call a model?” to “Can we operate model-powered workflows safely, predictably and economically?” That changes the architecture conversation.
- Token spend is becoming a business process issue. If non-engineering teams drive large volumes of AI usage, cost controls cannot live only in developer tooling. They need to be embedded into enterprise applications, workflows and procurement policies [4].
- Document workflows are often the hidden cost center. Converting PDFs into images, running vision models, extracting text, reformatting into Markdown and then prompting over the result can multiply token and compute usage unnecessarily [4].
- Model access is now part of the security perimeter. AI systems touch model registries, vector stores, SaaS APIs, secrets, user documents and internal data. Incidents involving AI platform integrations show why security review must include orchestration paths, not just prompts and model outputs [2].
- Fast prototypes can create false confidence. Agent-generated applications may work in demos, but production workloads require deterministic deployment, test coverage, dependency scanning, data access controls and runtime monitoring [3][5].
- Cloud architecture decisions now affect unit economics directly. Choices such as model routing, caching, context size, retrieval strategy, GPU reservation, batch processing and observability can materially change cost per task.
Kimbodo Engineering Perspective
In production AI systems, the core trade-off is usually not “best model versus worst model.” It is model quality, latency, security and cost per completed business task. Teams that optimize only for benchmark quality often overpay. Teams that optimize only for cost often ship unreliable workflows.
Model choice should be task-specific
Most enterprise AI platforms should not route every request to the most capable model. A practical system uses a model portfolio: small models for classification, extraction and routing; larger models for complex reasoning; embedding models for retrieval; and deterministic code or rules where AI is unnecessary.
This matters especially in document-heavy workflows. If a PDF contains selectable text, sending rendered page images to a multimodal model may be wasteful. A lower-cost extraction pipeline using OCR only when needed, layout-aware parsing, chunking and metadata preservation can reduce cost before the first LLM call is made.
LLMOps needs FinOps built in
Traditional MLOps tracked model versions, datasets, metrics and deployments. LLMOps also needs to track tokens, context size, prompt templates, tool calls, retrieval volume, cache hit rate, tenant-level usage and cost per workflow. The Accenture example in the reporting is a warning: if business users can create expensive workflows without feedback loops, spend will grow faster than engineering can optimize it [4].
Agentic systems need hard boundaries
Agentic coding and automation tools are useful, but they should not have unrestricted access to repositories, production credentials, cloud consoles or customer data. One-shot software generation demonstrates acceleration potential [3][5], but enterprise deployment requires policy enforcement, sandboxing, human approval gates and audit trails.
Security must cover the AI supply chain
The Hugging Face incident timeline reinforces that AI security includes more than prompt injection. It includes model provenance, dataset access, API credentials, CI/CD permissions, automation scripts, hosted inference endpoints, package dependencies and third-party platform integrations [2].
How We Would Implement It
1. Put a model gateway in front of all LLM usage
We would avoid direct application-to-model calls except for tightly controlled internal services. A model gateway should provide:
- Centralized authentication and authorization.
- Per-user, per-team, per-tenant and per-application quotas.
- Routing across approved model providers and self-hosted models.
- Prompt and response logging with configurable redaction.
- Token counting, cost attribution and budget alerts.
- Policy controls for sensitive data, regulated data and external model use.
- Fallbacks when a provider is unavailable or too slow.
This gateway becomes the control plane for cost, reliability and compliance. It also gives business leaders a consistent view of AI spend by workflow rather than by disconnected API key.
2. Build a document-processing pipeline before using LLMs
For PDF and document-heavy workloads, we would implement a staged pipeline:
- Detect whether the document has embedded text before using OCR.
- Use deterministic parsers for text, tables and metadata where possible.
- Apply OCR only to scanned pages or image regions that require it.
- Preserve page numbers, headings, tables and source references.
- Chunk documents based on semantic structure, not arbitrary character counts.
- Store normalized text and layout metadata for reuse.
- Use embeddings and retrieval to send only relevant context to the LLM.
This directly addresses the cost pattern described in the reporting: image-based PDF conversion can become a token and compute multiplier if treated as the default path [4].
3. Use workload-based model routing
We would classify requests before selecting a model. Example routing:
- Simple classification: small hosted model or self-hosted open model.
- Entity extraction: small model plus schema validation.
- Search and question answering: retrieval-augmented generation with strict context limits.
- Complex analysis: higher-capability model with expanded context and stronger evaluation.
- Code generation: isolated development environment, repository-scoped permissions and mandatory review.
The routing logic should be observable and adjustable. If a low-cost model fails a quality threshold, escalate to a stronger model. If the high-cost model is being used for routine extraction, downgrade the route.
4. Add evaluation and regression testing to the release process
Every production AI workflow should have an evaluation set tied to business outcomes. We would test:
- Answer accuracy against known cases.
- Grounding and citation correctness.
- Refusal behavior for unsafe or out-of-scope requests.
- PII and confidential data handling.
- Tool-call correctness.
- Latency and cost per successful task.
- Regression across model, prompt and retrieval changes.
This is where prototype quality becomes production quality. A generated application or agent workflow may be impressive in isolation, but it needs repeatable tests before it can support business-critical operations [3][5].
5. Separate experimentation from production
We would create distinct environments for AI experimentation, staging and production:
- Experimentation: limited data access, synthetic or anonymized datasets, low quotas and sandboxed tools.
- Staging: production-like infrastructure, fixed model versions, evaluation gates and security scanning.
- Production: approved models, audited prompts, monitored tool calls, incident response procedures and rollback paths.
This separation reduces the chance that a prototype agent, notebook or automation script accidentally gains access to sensitive systems. The security lesson from AI platform incidents is that automation boundaries must be explicit [2].
6. Choose cloud infrastructure based on workload shape
For most enterprises, we would not begin by self-hosting every model. We would use a hybrid approach:
- Managed APIs for high-capability reasoning, low operational overhead and faster iteration.
- Self-hosted open models for predictable high-volume tasks, data residency needs or cost-sensitive workloads.
- Serverless inference for intermittent workloads with variable demand.
- Reserved GPU capacity only when utilization is high enough to justify it.
- Batch processing for non-urgent document ingestion, summarization or enrichment jobs.
The right answer depends on volume, latency requirements, privacy constraints, model size and operational maturity. A self-hosted GPU cluster can reduce marginal inference cost, but it adds capacity planning, patching, observability, autoscaling and incident response responsibilities.
Risks, Costs and Security
Primary risks
- Runaway token usage: Long prompts, repeated context, image-heavy document processing and agent loops can create large bills quickly [4].
- Shadow AI workflows: Business teams may adopt tools outside approved controls, especially when official platforms are slow or restrictive.
- Data leakage: Prompts, retrieved documents, logs and tool outputs may contain confidential or regulated information.
- Supply chain exposure: Models, datasets, plugins, packages and hosted platforms can introduce security risk [2].
- Overreliance on generated code: Agent-created applications still need dependency review, secure defaults, tests and maintainability checks [3][5].
- Vendor lock-in: Application logic tightly coupled to one model provider can make cost optimization and resilience harder.
Cost controls to implement early
- Per-workflow budgets and alerts.
- Token limits by user, tenant and application.
- Prompt compression and context pruning.
- Semantic caching for repeated questions and document summaries.
- Embedding cache and retrieval result cache.
- Model routing based on task complexity.
- Batch queues for non-urgent processing.
- Chargeback or showback reporting to business units.
Security controls to implement early
- Centralized secrets management; no model API keys in client apps or notebooks.
- Least-privilege service accounts for agents and tool calls.
- Network egress controls for AI workloads.
- Prompt and response logging with redaction and retention policies.
- Content filters for sensitive data and policy violations.
- Model and dataset provenance tracking.
- CI/CD scanning for generated code and dependencies.
- Human approval gates for high-impact actions.
- Incident response playbooks for AI-specific failures.
The practical takeaway is straightforward: enterprise AI platforms need the same discipline as other production systems, plus new controls for tokens, prompts, retrieval, tools and model supply chains. The teams that succeed will treat AI infrastructure as an operating platform, not a collection of experiments connected directly to model APIs.
Where Kimbodo Comes In
Kimbodo builds and operates this in production for businesses — see our AI Infrastructure & MLOps practice. Wondering what it would cost for your organization? Get a preliminary range, timeline and architecture in about a minute.
Sources
- [1] Quoting John Gruber
- [2] Now we have a timeline of the OpenAI accidental attack against Hugging Face
- [3] Moonlight & Mayhem (Raccoon Heist by Codex + GPT-5.6 Sol Ultra)
- [4] The Tokenpocalypse Is Here: Companies Are Scrambling To Stop Spending So Much on AI
- [5] One-shotting a Raccoon Heist game using Claude Fable 5