Hosted Agent Services: Runtime Architecture and the Evolution of Billing Models
Explore how hosted agent services are reshaping cloud infrastructure and pricing. This article breaks down the three-dimensional billing model (cloud sandbox runtime, model inference, and plugin calls), the Durable Harness architecture for long-running tasks, enterprise use cases such as financial agent templates, and inference-level security mechanisms like the Inference Hook, offering practical guidance for architecture selection.
1. Introduction: From Model APIs to Hosted Agents
In the early days of generative AI, model providers primarily charged developers based on token consumption. However, as large language models have evolved from simple “conversational tools” into “agents” capable of autonomous planning, tool invocation, and complex task execution, token-only billing no longer reflects the true cost of the underlying infrastructure. Recently, a mainstream LLM provider launched a hosted agent service that bills sandbox runtime, model inference, and plugin calls as separate line items. This shift in business model signals that the “agent runtime environment” has formally emerged as an independent, billable infrastructure category in cloud computing.
This article examines the underlying logic and engineering practices of hosted agent services across four dimensions: technical architecture, billing models, application scenarios, and security mechanisms—providing a systematic technical reference for developers and enterprise users.
2. The Three-Dimensional Billing Model of Hosted Agents
Traditional model invocation billing is simple and intuitive, whereas hosted agent services introduce a more granular “three-dimensional billing formula”:
Total cost = cloud sandbox runtime fees + model inference fees + plugin call fees.
2.1 Sandbox Billing: The Continuous Cost of Isolated Environments
The cloud sandbox is a secure, isolated environment where agents execute code, read and write files, and perform complex computations. Under the published pricing, sandbox runtime is billed at 0.072 yuan per hour. If a cloud sandbox runs continuously for 30 days, the base environment cost is approximately 51.84 yuan.
From an engineering perspective, the separation of sandbox billing is an inevitable trend. When agents execute long-running tasks—such as data cleaning, model training, or continuous monitoring—they require a persistent runtime state. This state consumes not only compute resources (CPU and memory) but also dedicated filesystems and network namespaces. Independent sandbox billing pushes developers to pay closer attention to agent lifecycle management, such as proactively suspending sandboxes during idle periods to reduce costs.
2.2 Inference Billing: Traditional Token-Based Costs
Model inference remains the “brain” cost of an agent. This portion is calculated based on the number of input and output tokens, representing the core expense of logical reasoning, task planning, and natural language processing.
2.3 Plugin Billing: Mapping the True Value of Differentiated Capabilities
Plugins are the agent’s tentacles for interacting with the outside world. Official pricing shows significant variation in per-call plugin costs, ranging from 0.001 to 0.45 yuan:
- Basic information retrieval: Web search (around 0.03 yuan per call) and image search (around 0.045 yuan per call) are relatively inexpensive, mainly consuming web crawling and lightweight indexing resources.
- Deep data access: Financial data plugins (0.35 to 0.45 yuan per call) are considerably more expensive because their underlying data sources carry high commercial licensing costs, feature complex data structures, and demand strong real-time performance.
This differentiated pricing transparently reflects the acquisition costs of different external APIs, helping enterprises perform fine-grained ROI evaluations when building agents.
3. Architectural Evolution of the Agent Runtime Environment
At the core of a hosted agent service is the “Durable Harness”—a persistent runtime and orchestration system built on top of the model inference API. The Harness is a middleware layer surrounding the LLM, responsible for organizing model calls, tool execution, session management, and task scheduling.
3.1 Core Responsibility: Orchestration and Scheduling
The Harness acts as the central hub for task dispatch. When a user submits a complex instruction, the Harness decomposes it and decides when to invoke the model for reasoning, when to call external plugins for data, and how to verify results in the sandbox. It abstracts away the underlying complexity, allowing developers to focus on business logic.
3.2 Resilience for Long-Running Tasks: Failure Recovery and State Persistence
In real business scenarios, long-running tasks (lasting hours or even days) face numerous uncertainties: network jitter, API rate limiting, and model hallucinations. The Harness provides key resilience mechanisms:
- Session history persistence: Multi-turn conversations and intermediate states are stored in reliable storage media, ensuring the agent can restore context after interruptions.
- Failure recovery and timeout retry: When plugin calls fail or model inference times out, the Harness automatically captures exceptions and retries with exponential backoff according to preset policies, rather than terminating the task by throwing an error. This capability is the foundation for 24/7 unattended hosting.
3.3 Multi-Agent Orchestration
Single agents often struggle with highly complex tasks. Modern Harness implementations support multi-agent orchestration, allowing the definition of agents with different roles (such as “Planner,” “Executor,” and “Reviewer”) that collaborate to complete workflows. For example, in investment research modeling, one agent handles data retrieval, another builds the model, and a third validates the results.
4. Enterprise Use Cases and Templated Practices
To lower the barrier to enterprise adoption, hosted agent services typically provide a rich skill library (over 140 skills), a plugin ecosystem (over 30 plugins), and pre-built industry templates.
4.1 Internal System Integration and External Product Embedding
Enterprises can configure two core categories of applications via APIs, command-line tools, or web consoles:
- Internal productivity applications: Integrated with internal enterprise systems to handle business monitoring, automated operations response, and log analysis. These applications typically have strict data privacy requirements and demand stable long-term operation.
- External-facing services: Embedded into customer-facing products to deliver investment research assistants, intelligent customer service, and similar capabilities. These applications emphasize response speed and interactive experience.
4.2 Skill Libraries and Plugin Ecosystems: A Financial Example
Taking the financial industry as an example, the platform provides eight pre-built financial agent templates covering high-frequency business scenarios such as investment research modeling, IPO tracking, portfolio monitoring, regulatory case digests, and fund reconciliation. These templates integrate plugins that connect to mainstream financial data sources, including Wind, iFinD, and S&P Global (commonly used as industry references for financial data providers). Through templatization, financial analysts can drive agents through the entire workflow—from data extraction to chart generation—using natural language instructions without writing complex code.
5. Security and Compliance: Inference-Level Data Interception
In enterprise deployments, data security is a non-negotiable red line. The hosted service introduces an independent security component—the Inference Hook—demonstrating a high standard of security design.
The Inference Hook operates before each model inference call. Its core logic is to perform real-time review of task inputs and tool-returned content. The following pseudocode illustrates how it works:
def pre_inference_hook(user_input, tool_output):"""Security interception logic executed before each model inference"""# 1. Check whether the user input contains sensitive informationif contains_sensitive_data(user_input, enterprise_rules):return Action.BLOCK, "Input contains sensitive data; sending to the model is forbidden"# 2. Check whether data returned by tools (plugins) is compliantif contains_pii(tool_output, enterprise_rules):return Action.MASK, mask_pii_data(tool_output)# 3. Allow the request to proceedreturn Action.ALLOW, None
Through this mechanism, enterprises can define custom sensitive-word lists, regex rules, or data classification policies. When an agent retrieves external data via plugins and prepares to feed it into the LLM, the Hook will allow, mask, or block the content according to enterprise rules. By placing a security gate at the “inference boundary,” this architecture effectively prevents internal confidential data from leaking externally through the model’s context. This component is currently available primarily to certified enterprise users with strong compliance requirements.
6. Conclusion and Architecture Selection Recommendations
The separation of sandbox, inference, and plugin billing in hosted agent services is not merely a business model innovation—it is a profound reflection of the underlying logic of agent runtime architecture. Enterprise developers should keep the following in mind when selecting and designing their architectures:
First, plan cloud sandbox specifications and sleep strategies rationally based on task concurrency and continuity, to avoid generating ineffective runtime charges. Second, make full use of pre-built industry templates and the plugin ecosystem to avoid reinventing the wheel. Finally, security mechanisms such as the Inference Hook must be deeply integrated into the agent orchestration pipeline to balance business innovation with data compliance. As agent technology continues to evolve, a highly available, billable, and strongly secured Harness environment will become a core competitive advantage for enterprises building AI-native applications.
