Let agents operate real websites within clear boundaries
When someone says, “Change the delivery note on SO-1002 to ‘arrive by Friday’,” an agent must find the right order, check whether it can be changed, submit the update, and verify that it was saved. Understanding the request is only the first step. The hard part is operating within business rules and returning evidence of the result.
Common ways to operate a website
There are three common approaches. They solve different problems and carry different engineering costs.
| Approach | How it works | Main advantage | Main cost |
|---|---|---|---|
| Browser automation | Uses screenshots, the DOM, Playwright, or CDP to find controls, then clicks and types | May work without changing the website; useful for third-party pages you cannot integrate with | Redesigns, dialogs, and similar controls can break targeting. The agent may need repeated observation and retries. A click log may not identify the business record or outcome. |
| Direct business APIs | Exposes read and write endpoints for the agent to call with parameters | Fast when the interface is clear; services can record requests and results | The agent must handle IDs, lookups, permissions, and workflows. Broad endpoints increase risk, and bypassing the page may skip its validation or confirmation. |
| Custom agent tools | Implements a function such as create_course or update_order for a specific workflow | Can constrain parameters and business rules; the execution path is explicit | Each application, agent, and workflow may need separate code. Lookup, confirmation, page feedback, and audit can be rebuilt repeatedly, while duplicated business logic drifts over time. |
No approach guarantees safety, auditability, or success on the first attempt. Browser automation helps when a page cannot be integrated with. APIs fit stable service calls. Custom tools fit well-defined business actions. The enterprise question is how to expose the capabilities it understands best while keeping control in the application.
Enterprises want to expose capabilities and keep control
An enterprise knows its business and which operations an agent may perform. It may want to expose actions such as “check this student’s membership cards” or “fill in the current course,” while still deciding:
- which data and actions are available to this user and agent;
- which tenant, page, record, and session an action may affect;
- which information can reach the model and which actions require confirmation;
- who initiated an action, what changed, how it ended, and how to investigate or recover from a problem.
An agent does not need the whole database, the entire frontend store, or every control on the page. It needs only the information required for the current task:
- Location and business object: the current page, section, and selected record;
- Available capabilities: what each action does, its parameters, preconditions, and current availability;
- Necessary data: fields needed to make a decision, plus a way to find records by business information such as a name;
- Risk and outcome: whether confirmation is required and what happened on success, failure, or partial completion.
Users should not have to provide internal IDs. The page can resolve “Lin Yue” through search and candidate choices. If names match or information is missing, the agent should ask instead of guessing an ID.
What Pling is
Pling is a page capability contract and runtime. An application declares the actions it is willing to expose, their targets, and the context needed to use them. Pling makes currently available capabilities available to an in-page assistant or, through Agent Surface, to an external agent. Calls pass through page-side checks and execution, then return a result to the agent.
The guiding principle is to change as little business code as possible and reuse the information and behavior the application already has. Existing forms, event handlers, state management, and backend requests remain responsible for business behavior. Pling does not replace the model, frontend framework, backend authorization, or business approval. The server remains the authority for access and data changes.
Pling is not limited to clicking controls. An operation that belongs in the interface can be declared on an existing control. A lookup or multi-step business operation can use a narrowly scoped function action. Both use the same capability descriptions, availability checks, confirmation rules, and result reporting. An in-page assistant and external agents can reuse the same declarations.
Look up records by name, not by internal ID
Suppose a user asks, “How many yoga sessions does Lin Yue have left?” If a query accepts only studentId, the user would need to find an internal identifier first. Exposing the whole student API to an agent would also reveal more data than the task needs.
Declare a read-only business action that accepts information the user knows:
merchant.get_student_cards({ query: "Lin Yue" })The action calls the application's existing student lookup and handles three outcomes: no match asks the user to check the name or phone number; multiple matches return only names and masked phone numbers so the user can choose; one match returns only the card names, remaining sessions or balance, expiry, and status needed to answer. The internal ID stays in the application and does not enter the model result.
The demo seed data contains two students named Lin Yue. The first lookup returns candidates instead of silently choosing the first one:
{
"found": false,
"needsClarification": true,
"candidates": [
{ "name": "Lin Yue", "phone": "139****1234" },
{ "name": "Lin Yue", "phone": "139****4321" }
]
}After the user chooses the student with phone number ending in 1234, the application uses its stable ID internally and returns only the fields needed for the answer. In the demo, that student has three sessions left on a yoga monthly card and one session left on a private trial card.
The lookup does not need to change pages. The user sees the answer in chat; if identity needs confirmation, chat shows the masked candidates. Writes should still reuse the page or business service validation and require confirmation according to their risk. The Bingcao workspace example shows this flow and its source: Example 08: Bingcao merchant workspace.
A Vue integration, step by step
Consider a Todo list that already has a toggleTask business function and a button bound to it. Create one Pling instance when installing the Vue adapter:
import { createApp } from "vue";
import { createPling } from "@plingjs/vue";
import "@plingjs/vue/style.css";
import App from "./App.vue";
const pling = createPling();
createApp(App).use(pling.plugin).mount("#app");Expose the row’s business fields and describe the existing button:
<li
v-for="task in tasks"
:key="task.id"
v-record="{
data: task,
fields: {
title: task.text,
status: task.done ? 'completed' : 'open',
},
}"
>
<button
type="button"
v-tool="{
id: `toggle@${task.id}`,
desc: task.done
? `Mark “${task.text}” as incomplete.`
: `Mark “${task.text}” as complete.`,
kind: 'write',
}"
@click="toggleTask(task.id)"
>
{{ task.done ? 'Mark incomplete' : 'Mark complete' }}
</button>
</li>v-record lets the agent identify a row by its title and status. v-tool explains what the button does. The existing @click and toggleTask remain unchanged. Undeclared controls do not automatically become Pling capabilities; the developer chooses what to expose. Add v-scope when multiple sections or routes need context. For a complete Todo integration, follow the Vue quick start.
How a call reaches the page
Suppose the user asks, “Mark the first Todo as complete.” The model request contains three kinds of information:
system: agent rules + current page observation
page: Todo list
record: t1 “Review the release checklist”, status open
capability: toggle(record), mark the selected Todo complete or incomplete
tools: currently available actions and their parameter schemas
messages: user and assistant conversation, plus earlier calls and resultsAction descriptions and record fields come from application declarations. The runtime rereads page location, state, availability, and feedback before each model request. The model request contains the current page observation and conversation history. Pling does not send the entire DOM or frontend store by default; the application decides which declared fields belong in model context. In production, send model requests through your own server or gateway so provider credentials stay out of the browser.
After the model selects toggle with record: "t1", the execution path is:
- Pling checks that the action exists, the parameters are valid, and the current page allows it. If confirmation is required, it waits for the user first.
- The runtime resolves
t1to the matching row, checks that the target is available, and triggers the original button handler. - The page runs
toggleTask, updates its state, and applies its existing validation. - Pling collects the execution result and page changes, then rebuilds the page observation before the next request.
- The agent reports the result from the receipt instead of claiming success based on a click alone.
Tool calls are sent in the OpenAI-compatible request’s tools field, alongside the system instructions and conversation messages. After execution, the assistant’s tool call and a role: "tool" result are added to the conversation. The next request uses a fresh page observation instead of relying on stale state. Inspect one agent run to see the actual request, arguments, and receipt.
Safety, audit, success, and cost
Pling provides a constrained, inspectable path. The final outcome still depends on how the application is integrated.
| Goal | What Pling can provide | What the application must still do |
|---|---|---|
| Safety | Send only declared capabilities and necessary context; check current availability; support confirmation and scoped Surface exposure | Reauthorize against the current user, tenant, and resource on the backend; manage secrets, sessions, and high-risk approval. A declared action is not business authorization. |
| Auditability | Associate an action with its target record, result, confirmation, and observed page changes; provide run inspection | Choose where audit records are stored, who can read them, and how long they are kept. Avoid logging secrets and unnecessary personal data. |
| First-attempt success for irreversible actions | Use stable record references, explicit parameters, availability checks, confirmation, and post-action verification to reduce guessing and blind retries | Implement idempotency, transactions, and duplicate-submission protection on the backend. A network timeout can happen after a server commits but before the client receives the receipt; Pling cannot promise absolute exactly-once execution in a distributed system. |
| Speed and cost | Fold repeated row actions and bound context; use one business function action instead of several UI round trips where appropriate | Choose UI or narrow API paths for each task. Model, network, and call count determine actual latency and cost; there is no fixed savings percentage. |
Pling cannot make every action correct automatically or stop a client with browser-level access from bypassing it. It makes the path the application chooses to expose explicit and verifiable. The application and backend still own authorization, idempotency, and data governance.
See it in action
- Course workspace example: see an agent guide and act within an existing course page.
- All live examples: browse different frameworks and business workflows.
Choose an integration path
- Vue 3 integration path: start with a working Todo page and add Pling step by step.
- React integration path: declare actions and mount the assistant in a React app.
Choose a learning track
- Vue 3: continue from first integration to page capabilities, tasks, and production setup.
- React: learn the React adapter and its complete integration path.
- Vanilla / jQuery: integrate with a plain JavaScript or jQuery page.
- Vue 2 Legacy: follow the compatibility path for Vue 2 projects.
Understand the runtime
Read How Pling works and What the agent can see for the page capability model, context, and execution flow.
The quick starts require a Vue 3 or React application, Node.js 20 or newer, and a model endpoint that accepts OpenAI-compatible Chat requests. Pling does not host a model or require a specific provider; the application chooses the endpoint, authentication, and production gateway.

