Overview
Agent comments let your AI agents participate in collaboration the same way humans do: by leaving comments and findings anchored to a document. Instead of building a separate UI for agent output, your agent calls the same REST APIs that power the Comments feature, and the findings render in the standard Velt comments experience. Any agent that can make an HTTP request can do this: a custom agent you create with the Review Agents API, or an external agent running in your own framework (LangChain, CrewAI, a cron job, etc.).How it works
- Your agent runs and produces a finding (a spelling error, an accessibility issue, a code-review note, etc.).
- Your agent calls the Add Comment Annotations API with an
agentblock attached to the root comment. - The finding renders in Velt as a suggestion with Accept and Reject buttons that humans can review.
- Your app reacts to the outcome: read agent comments back with the Get Comment Annotations API, or subscribe to the
suggestionAccepted/suggestionRejectedevents in your frontend.
Properties
- An agent comment is a regular comment annotation with an
agentblock attached to its root comment. There is no separate agent-comments API or data store. You add, read, update, and delete agent comments with the same Comment Annotations and Comments REST APIs. - When you attach an
agentblock to the root comment (commentData[0]), the server stampssourceType: "agent"on both that comment and the annotation, and generates the annotation-levelagentblock. When you attach it to a reply instead, only that comment is marked as agent-authored; the annotation root stays a normal comment. - Set the annotation
typeto"suggestion"so the finding is classified as an agent suggestion and renders with Accept / Reject buttons instead of as a regular comment. - Agent comments support two origins:
velt(a built-in agent likespell-check, or a custom agent you create with the Review Agents API; theagentIdis verified server-side) andexternal(an agent running in your own framework, where theagentNameyou supply is the source of truth). - When a reviewer accepts or rejects a finding, the outcome is emitted on the comment element as the
suggestionAccepted/suggestionRejectedevents, so you can apply the change to your own data or trigger follow-up logic.
APIs
Backend APIs
Add Agent Comments
- Add an agent comment using the Add Comment Annotations REST API. Attach an
agentblock to the root comment (commentData[0]) and set the annotationtypeto"suggestion". Learn more - See The agent object below for all the fields you can send.
agentSource: "external" and supply your own agentName:
Reply as an Agent
- Add an agent-authored reply to an existing comment annotation using the Add Comments REST API with an
agentblock on the comment. Learn more - Annotation-level fields such as
typeare set when the annotation is created. They are not accepted on this endpoint.
Get Agent Comments
- Get agent comments using the Get Comment Annotations REST API with agent-specific filters. Learn more
- Only one agent filter may be supplied per request.
cURL
- Agent annotations in the response carry
type: "suggestion"andsourceType: "agent"at the annotation root, an annotation-rootagentblock, and anagentblock on each agent-authored comment (comments[].agent). - To retrieve individual comments within a specific annotation, use the Get Comments REST API. Learn more
Update Agent Comments
- Update annotation-level fields (status, assignee, location, etc.) using the Update Comment Annotations REST API. Learn more
- Update the content of individual comments within an annotation using the Update Comments REST API. Learn more
Delete Agent Comments
- Delete entire agent comment threads using the Delete Comment Annotations REST API. Filter by
annotationIdsoruserIds(e.g. your agent’s user ID), or use the combinable agent filters —agentId,agentSuggestions, andagentUrls— to delete e.g. one agent’s still-pending suggestions for specific pages. Learn more - Delete individual comments within a thread using the Delete Comments REST API. Learn more
Frontend APIs
Handle Accept / Reject Events
Because agent findings render with Accept and Reject buttons on the comment dialog, the outcome is emitted on the comment element. Subscribe to thesuggestionAccepted and suggestionRejected events to apply the change to your own data or trigger follow-up logic. The SDK records the outcome and persists the suggestion. Applying the change is your code’s job.
The agent object
Attach anagent object to the root comment (commentData[0]) when adding an agent comment, or to any comment when replying as an agent. It is discriminated on agentSource:
The reason object
Thereason object carries the finding’s details. Here’s each field with a description and an example value.
Don’t conflate the two “fix” fields:
suggestion is prose meant for a human to read in the comment, while suggestedFix is the actual replacement value your code applies. In the color-contrast example above, suggestion explains the change (“Darken the button background to at least #1A1A1A.”) while suggestedFix is just the value itself ("#1A1A1A").reason looks like:
title, description, severity) are required. Everything else is optional, and any extra custom fields you add beyond this list are preserved by the server.
