Skip to content

Let agents operateforms, not markup.

An agent that drives a UI through CSS selectors breaks when the markup changes. Klyroo.Agent works with the labels, values and named actions of the controllers behind your UI.

Install dotnet add package Klyroo.Agent --prerelease
The Klyroo.Agent line and its 4 stations
Klyroo.Agent
  1. Snapshot
  2. Query
  3. Act
  4. Permissions
KlyrooStack Klyroo.Stack, the interchange of the network
Program.cs 16 lines
Program.cs
var schema = FormSchema.For<Project>(s =>
{
    s.Title = "Project settings";
    s.Field(p => p.Region, f => f.Options(
        [new("us-east", "US East"),
         new("eu-west", "Europe West")]));
    s.Field(p => p.Token, f => f.AsPassword());
});
var agent = new AgentBridgeService();
agent.RegisterForm(
    new FormController<Project>(schema, new Project()));

var snapshot = agent.Snapshot();
var result = await agent.ActAsync(
    [new("Region", "setValue", ["eu-west"]),
     new("Token", "setValue", ["s3cret"])]);

RegisterForm hands a controller to the bridge. The agent never sees markup, only the labels, values and actions of the controller.

What the model sees the snapshot
c1 select "Region" = us-eastc2 input "Token" = [redacted]c3 form "Project settings" = clean
The tool call act, as the model sends it
{ "steps": [  { "ref": "Region", "action": "setValue", "args": ["eu-west"] },  { "ref": "Token", "action": "setValue", "args": ["s3cret"] }] }
c1 setValue ok eu-westrefused Step 2: action "setValue" on "Token" (c2) was refused:the field is sensitive and the application does not letthe AI model change it.
The form afterwards sample data
Region
Europe West
Token
[redacted]

the bridge reads the controller, not the markup the controller holds eu-west: the form is now dirty the value is never in a snapshot, a result or a change the token is unchanged

Everything it does

Snapshot
Lists every registered component with a stable reference (c1, c2, ...), its label, current value and the actions it accepts, capped at 100 entries.
Query
Lists the choices of a select or filter, filtered by text, without opening a popup. Matching ignores case and accents.
Act
Runs named actions (setValue, toggle, clear, reset, submit, nextStep, setView, refresh, and the spreadsheet actions assignColumn, answerValue, editCell, discardRows and more) by reference or label, stops at the first failing step and reports why.
Typed values
Values, step arguments, query records and tool results are typed (AgentValue, AgentArgument, AgentRecord, AgentToolResult), with no object in the public API. setValue on a form field is read by the codec of the field in Klyroo.Form (JSON numbers keep their digits, text, lists, option labels) and refused with the reason when it does not fit the type of the member.
Permission gate
AllowPolicy and a per-call allow callback can refuse any step. Steps that need confirmation (forms, which are registered with confirmSubmit: true by default, a spreadsheet submit or clearFile) are refused when no policy is set.
Spreadsheet imports
The snapshot value is a summary (step, counts, open questions, unmapped required columns) and Query pages through rows and issues, addressed by the row number the user sees.
Secret redaction
Password and one-time-code fields (any sensitive field) appear as [redacted] in snapshots, results and observed changes, and the model cannot write them unless you name them in RegisterForm(form, allowSensitiveWrites: [...]).
Observe
Observe delivers one ObservedChange per successful step, with the previous and new value.
Tool definitions
GetToolDefinitions returns the snapshot, query and act tool descriptions, with read-only and consequential hints and the JSON schema of the arguments, and InvokeToolAsync runs a call from its raw JSON arguments and returns an AgentToolResult.
Microsoft.Extensions.AI
Klyroo.Agent.AI turns the bridge into AIFunction instances for any IChatClient, with an approval step for confirmation-required actions.
Browser runtime
A separate JavaScript module (klyroo-agent.js) offers the same three operations over the DOM and can register them with WebMCP when the browser provides it.

Packages

  • The data types of the bridge (AgentActStep, AgentArgument, AgentValue, AgentActResult, AgentToolResult, ObservedChange, ...) and UndoStack<T>. No dependencies, NativeAOT compatible.
  • AgentBridgeService, AddKlyrooAgent(), and the browser runtime served from _content/Klyroo.Agent/. Depends on Klyroo.Agent.Core, Klyroo.Form.Core, Klyroo.Dashboard.Core and Klyroo.Spreadsheet.Core.
  • AsAIFunctions(): the bridge as Microsoft.Extensions.AI functions, with approval for confirmation-required actions. Depends on Klyroo.Agent and Microsoft.Extensions.AI.Abstractions.

Install it, then open the first page.

Change here for the other lines

  • Klyroo.UI Accessible Blazor components for the web and .NET MAUI Blazor Hybrid, styled with Tailwind CSS v4
  • Klyroo.Query Typed query model, URL state sync, and IQueryable / EF Core execution
  • Klyroo.Table Data lists with table and card-grid layouts, filters, selection and actions
  • Klyroo.Form Schema-driven forms, validation and wizards
  • Klyroo.Dashboard Dashboard controller, filters and Blazor blocks: stats, gauges, charts, tables and feeds
  • Klyroo.Display Code highlighting, secret and file list components, media player controls and file preview
  • Klyroo.Spreadsheet Import wizard for CSV, TSV and pasted data, with column and value mapping
  • Klyroo.Agent Bridge that lets AI agents read and act on Klyroo forms, dashboards and imports
  • Klyroo.Hotkey Server-side .NET client for Hotkey cloud browsers, human handoffs and signed webhooks
  • Klyroo.Stack Meta-package, MCP documentation server and dotnet new templates