Digital Workers Succeed or Fail on the AI Foundation, Not the Application Layer
This article explains why enterprise digital workers depend on a solid AI foundation more than on their application-layer features. It covers a unified model gateway, point-based usage accounting with pre-holds and settlement, permission and data governance, observability and quality evaluation, and a three-stage rollout plan.
1. Why Build the Foundation First
Digital workers are AI agents powered by large language models. They complete tasks inside enterprise systems, such as running queries, filling in forms, assisting with approvals, answering customer service questions, and generating reports. The interfaces and workflows of these products may look quite different. Underneath, however, they rely on very similar capabilities: which models they call, how calls are billed, who can access which data, and how problems are traced when they occur. Together, these capabilities form the enterprise AI foundation.
Application-layer features can be copied quickly. A foundation requires sustained investment. A digital worker product without stable model access, clear usage accounting, and a reliable permission system will soon face rising costs, unauthorized data access, or unstable response quality after launch. To judge whether a digital worker solution is sustainable, check the strength of its foundation first.
2. Unify Model Access to Reduce Fragmented Procurement
In the early days, enterprises often used large models in a fragmented way. Each business unit signed its own contract with a model provider, stored its own API keys, and settled its own bills. This approach creates three main problems.
The first is fragmented procurement. One company may have many contracts, billing cycles, and approval workflows, which makes cost reconciliation difficult for the finance team.
The second is technical coupling. Business code calls one vendor’s API directly. When the company needs to switch models, it must change many call sites.
The third is missing governance. API keys are scattered, and call records cannot be consolidated. The company cannot answer basic questions, such as which department used how much, and for which scenarios.
A better approach is to add a unified gateway between the business applications and the models. The gateway exposes a consistent calling interface externally. Internally, it handles routing, authentication, rate limiting, metering, and logging. Business teams only need to specify the type of capability they require, such as long-text understanding, code generation, or low-latency question answering. The gateway then decides which model handles the request based on policy.
The gateway design requires clear boundaries. A unified abstraction does not erase all differences. Models differ in context length, output format, tool-calling ability, and price. The gateway should expose the necessary capability labels so that callers can choose as needed, rather than pretending that all models are fully equivalent.
3. Point-Based Billing: The Operating Logic
When an enterprise converts model calls into points or quotas, both finance and business teams can understand costs more easily. The core of point-based billing is a verifiable metering scheme. It converts calls to different models, with different input and output lengths and different features, into one common unit.
Implementing this requires attention to the following areas.
1. Consistent metering. Each call records the tenant, user, application, model, input token count, output token count, latency, and request ID. Metering should rely on the usage information returned by the model, and the raw logs should be kept for reconciliation.
2. Separate pre-holds from settlement. Before a call, hold the estimated cost. After the call, settle the actual usage. This prevents calls from exceeding the available balance. If estimates deviate significantly from actual usage, recalibrate the estimation model regularly.
3. Quotas and alerts. Set monthly quotas by department or project. Send an alert when usage reaches a threshold. When usage exceeds the quota, the system can either downgrade the request to a lower-cost model or suspend the service. Administrators should configure thresholds and actions, not hard-code them.
4. Versioned price tables. Model prices change over time, and historical bills must reflect the prices in effect at the time of each call. Price tables should include effective dates, and settlement should match each call to the price in effect at its timestamp.
The following sample code illustrates the basic pre-hold and settlement flow. The class and method names are for illustration only. A production implementation should integrate with the enterprise’s own accounting system.
class QuotaGateway:def __init__(self, ledger, price_table, backend):self.ledger = ledgerself.price_table = price_tableself.backend = backenddef invoke(self, tenant_id, model_name, request):# Pre-hold the estimated cost before the call. Reject the request if the balance is insufficient.estimated = self.estimate_cost(model_name, request)if self.ledger.get_balance(tenant_id) < estimated:raise RuntimeError("Insufficient quota")self.ledger.hold(tenant_id, estimated)try:response = self.backend.call(model_name, request)except Exception:self.ledger.release(tenant_id, estimated)raise# Settle the actual usage after the call and release the unused held amount.actual = self.compute_cost(model_name, response.usage)self.ledger.settle(tenant_id, held=estimated, actual=actual,ref=response.request_id)return responsedef compute_cost(self, model_name, usage):price = self.price_table.lookup(model_name, usage.timestamp)return (usage.input_tokens * price.input+ usage.output_tokens * price.output)
This code highlights three points. If a call fails, the pre-hold is released so the quota is not tied up. Settlement keeps the request ID for traceability. Prices are looked up by timestamp, which keeps historical bills accurate.
4. Permissions and Data Governance
Digital workers access business data, so the foundation must answer one question: who can let an agent read which data, and under what conditions? Identity, roles, and data classification must be part of a unified design.
First, each agent should run under a clearly defined identity. It should not share a super-user account. Each agent should be bound to a service identity and granted only the minimum permissions needed for its task.
Second, data access should pass through a policy check. Policies can decide whether to allow access based on data classification, user role, and operation type. Each decision should be recorded in the audit log.
Third, inputs and outputs need filtering. Sensitive fields can be masked before they enter the model. Model outputs can be checked for content before they are returned to users. Scenarios involving personal information must also comply with the relevant regulations on data minimization and purpose limitation.
Finally, call logs are sensitive data in their own right. Logs should be encrypted at rest, kept only for a defined retention period, and visible only to authorized personnel.
5. Observability and Quality Evaluation
Once the foundation is live, managers need to know whether the digital workers are actually useful. Observability generally covers three layers.
At the system level, monitor request volume, error rate, latency percentiles, and timeout ratio to detect service anomalies early. These metrics can feed into a standard monitoring and alerting system.
At the cost level, break down usage by department, application, and model, and track how the cost per task changes over time. If the cost of a single task in one application keeps rising, the cause is often prompt growth or retrieval results that are too large.
At the quality level, build an evaluation set. The evaluation set should come from real business questions and cover common tasks as well as edge cases. Re-run it after every model or prompt change. Relying only on manual spot checks makes regressions hard to catch.
6. Rollout Path and Vendor Selection
To build a digital worker foundation, enterprises should proceed in three steps.
Step one is unified access and metering. Consolidate scattered model calls into a gateway, and implement unified authentication, logging, and usage statistics. This step requires a small investment and provides immediate cost visibility.
Step two is quotas, permissions, and governance. Establish department-level quotas, an agent identity system, and a data classification policy. This moves risk control to an earlier stage.
Step three is evaluation and continuous optimization. Build an evaluation set and a quality dashboard. Use the data to guide model selection and prompt iteration.
When comparing solutions, consider these dimensions: whether the platform supports multi-model routing and fallback, whether metering and billing can integrate with the enterprise’s financial system, whether the permission model is granular down to the agent level, whether logs can be exported to meet audit requirements, and whether migration costs are manageable.
Competition among digital workers will continue to unfold at the application layer. The long-term results, however, depend on whether an enterprise can turn model capabilities into managed, measurable, and traceable foundational services. Build the foundation first, and the applications on top will have stable room to grow.
