AI Agent Task Results: A Practical Design for Publishing, Verifying, and Accumulating Trustworthy Work

    AI agents can now run for minutes or hours to repair code, clean data, generate documents, and run inspections, but when their output is self-reported, the results are hard to trust. This article presents a four-layer design for an agent result-accumulation system: an identity access layer, a structured recording layer, a governance and workflow layer, and a trusted-incentive layer. It covers a three-part instance-level identity model, API-based publishing that stays inside the task environment, a task log metadata schema that mirrors task-side data, a three-role permission matrix with separation of duties, a state machine that governs the log lifecycle, hash-based anchoring and evidence records, multi-protocol access, progress and badge design, a reference architecture, and seven engineering best practices. The goal is to turn each agent conclusion into something with a verifiable task, instance, and review trail, so agents move from "able to work" to "trusted with the work."

    1. Where the problem starts: agents can do the work, but they can’t say what they did

    Agents have moved from “being able to chat” to “being able to do the work.” With planning, memory, tool calling, and autonomous execution, an agent can run continuously for tens of minutes or even hours and complete structured tasks such as code repair, data cleaning, document generation, and inspection or troubleshooting. In scenarios like multi-agent collaboration, task bounties, and human-in-the-loop delivery, one question keeps coming up: what exactly did the agent do, how well did it do it, and is the result real?

    When the answer is only the agent’s own account, its credibility is limited. A lack of objective evidence produces four kinds of problems:

    • Opaque process: intermediate steps, tool calls, and failed retries stay in the conversation context and become hard to reconstruct once the task ends.
    • Hard-to-verify results: the customer only sees the conclusion and has no way to tell whether the result actually came from the corresponding task.
    • Hard-to-measure contribution: bounty settlement, performance evaluation, and reputation building all lack a unified proof.
    • Hard-to-trace risk: when a misoperation, privilege escalation, or data leak happens, there is no complete chain of responsibility.

    So the agent’s task process and results need to be turned into a structured, linkable, verifiable, and traceable task log. This article breaks down the design points and practices of an agent result-accumulation system across four layers: identity access, structured recording, role-based publishing, and trusted accumulation.

    2. Capability overview: four layers forming an “identity–record–trust–incentive” loop

    A complete agent result-accumulation system can be divided into four layers:

    Layer Core problem it solves Key mechanism
    Identity access layer Who is doing the work, and under which identity it is recorded Agent registration, authentication, authorization, plus direct publishing via an API
    Recording structure layer What to record and how to express it A unified metadata model that is isomorphic with the task data
    Governance and workflow layer Who can publish and who confirms Role-based access control and a review state machine
    Trusted-incentive layer Why it should be believed and how it becomes visible Task-ID anchoring, summary attestation, and progress/achievement dashboards

    The four layers interlock: identity is the foundation, structure determines usability, governance ensures quality, and trust plus incentives keep the system running over the long term.

    3. Identity access: let the agent work without leaving its task environment

    3.1 From “account thinking” to “instance identity”

    In traditional systems, one operating subject maps to one user account. Agent scenarios are usually one-to-many: a single developer can deploy multiple instances, and each instance may handle multiple tasks at the same time. The identity model should therefore have three tiers:

    1. Owner: a person, team, or service account that holds management rights over the agent instances.
    2. Agent instance: each running instance has a unique identifier and its own independent credentials.
    3. Task context: each concrete task carries a task identifier.

    With instance-level identity, auditing can answer two key questions: which instance produced a given log, and which task that instance was running at the time?

    3.2 Publishing doesn’t require “switching screens”

    Agents register, authenticate, and publish through a programming interface (API), with no need to switch to a web page and enter data by hand. A typical flow looks like this:

    1. Agent starts → exchange the instance credential for an access token → run the task (record steps, elapsed time, artifacts)
    2. → task ends → call the publishing API with the task ID and token → receive a log ID and attestation info

    “Staying inside the task environment” matters for three reasons:

    • No loss of results: raw data is submitted directly, without manual transcription.
    • Controlled latency: results are stored the moment the task ends, not dependent on human memory.
    • Fewer errors: field validation happens at the entry point, avoiding repeated rework from formatting issues.

    3.3 Sample code: register, publish, and poll

    The following example only illustrates the flow and does not represent the API contract of any specific platform:

    1. import os, time, urllib.request
    2. # The constants below are illustrative configuration; a real system should follow its own API contract
    3. AGENT_API = os.environ["AGENT_API"] # Identity service endpoint
    4. LOG_API = os.environ["LOG_API"] # Result publishing service endpoint
    5. AGENT_KEY = os.environ["AGENT_SECRET"] # Instance credential, read only from env vars or a secret manager
    6. AGENT_ID = os.environ["AGENT_ID"] # Unique instance identifier
    7. def call(url, payload=None, token=None, method="POST", timeout=10):
    8. data = None
    9. if payload is not None:
    10. if isinstance(payload, (dict, list)):
    11. import json
    12. data = json.dumps(payload, ensure_ascii=False).encode("utf-8")
    13. elif isinstance(payload, bytes): # also accept a raw text body for plain-text protocols
    14. data = payload
    15. else:
    16. raise TypeError("unsupported payload")
    17. headers = {"Authorization": f"Bearer {token}"} if token else {}
    18. if data is not None:
    19. headers["Content-Type"] = "application/json"
    20. req = urllib.request.Request(url, data=data, headers=headers, method=method)
    21. with urllib.request.urlopen(req, timeout=timeout) as resp:
    22. return resp.read()
    23. # 1) Register: on startup, declare capabilities and ownership to obtain an instance-level identity
    24. register = call(f"{AGENT_API}/v1/agents", {
    25. "agent_id": AGENT_ID,
    26. "capabilities": ["code_repair", "data_cleanup"], # declare the task types it can take on
    27. })
    28. # 2) Authenticate: exchange the instance credential for a short-lived token (illustrative)
    29. token = call(f"{AGENT_API}/v1/token", {"agent_id": AGENT_ID, "secret": AGENT_KEY},
    30. method="POST").decode()
    31. # 3) Publish: after the task ends, submit the structured log directly
    32. result = call(f"{LOG_API}/v1/tasks/T-20260314-0087/logs", {
    33. "agent_id": AGENT_ID,
    34. "summary": "Fixed missing rows in the order export API at pagination boundaries",
    35. "solution": "Traced the cursor not being ordered by primary key; switched to a composite sort on (primary key + creation time), after which regression passed",
    36. "bounty_amount": 1200,
    37. "bounty_currency": "CNY",
    38. "started_at": "2026-03-14T10:02:11Z",
    39. "completed_at": "2026-03-14T10:41:37Z",
    40. "artifacts": [
    41. {"type": "file", "uri": "obj://agent-artifacts/T-20260314-0087/report.md",
    42. "sha256": "9f2c... (digest omitted)"}
    43. ]
    44. }, token=token)
    45. # 4) Poll review status: on token expiry or network jitter, fetch a new token and keep querying
    46. log_id = "L-000123" # the real value should come from the previous response
    47. deadline = time.time() + 24 * 3600
    48. while time.time() < deadline:
    49. try:
    50. status = call(f"{LOG_API}/v1/logs/{log_id}", token=token, method="GET").decode()
    51. if '"verified"' in status or '"rejected"' in status:
    52. break
    53. except Exception:
    54. token = call(f"{AGENT_API}/v1/token",
    55. {"agent_id": AGENT_ID, "secret": AGENT_KEY}).decode()
    56. time.sleep(30)

    4. Structured recording: what a task log should contain

    4.1 The structured article and its metadata

    A task log is essentially a “machine-readable, human-reviewable” structured article. It should include at least the following fields:

    Field Meaning Notes
    log_id Unique log identifier Generated by the publishing service; the primary key for full-text indexing and reference
    task_id Original task identifier Must be issued authoritatively by the task side; the anchor for tracing back
    agent_id The instance that produced the log Combined with the version, it distinguishes behavior across instance versions
    task_category Task category e.g., code repair, data analysis, content generation
    summary Summary For reviewers and readers; highlights the result and its impact
    solution Solution body Problem localization, handling steps, and verification method; structured text is preferred
    artifacts Artifact list Code diffs, reports, datasets, etc.; usually stored in object storage and identified by digest
    bounty_amount / bounty_currency Bounty amount and currency Amount and currency stored separately to avoid errors introduced by currency conversion
    started_at / completed_at Start and completion time Use UTC timestamps uniformly, making elapsed time easy to compute
    status Review status Takes a value from one of the states in the review state machine

    4.2 Isomorphic with the task data

    The first principle of structured design is to be isomorphic with the task-side data: log fields should map directly to the raw fields in the task record rather than making the agent “re-narrate” them at submission time. This avoids two common errors at the source: misaligned fields, and metrics the model “fills in” that never existed.

    The second principle is that a log references sensitive data, it does not copy it. The artifacts themselves live in controlled storage; the log only keeps the controlled address and a digest. Secrets, tokens, personal information, and other sensitive content in the body are filtered or masked before publishing.

    A sample structure follows (all values and content are examples):

    1. {
    2. "log_id": "L-000123",
    3. "task_id": "T-20260314-0087",
    4. "agent_id": "agent-4b21f0e8",
    5. "agent_version": "1.6.2",
    6. "task_category": "code_repair",
    7. "summary": "Fixed missing rows in the order export API at pagination boundaries",
    8. "solution": "Root cause: cursor not ordered by primary key... Steps: ... Verification: added boundary cases and passed regression",
    9. "artifacts": [
    10. {"type": "diff", "uri": "obj://agent-artifacts/T-20260314-0087/fix.patch",
    11. "sha256": "9f2c... (digest omitted)"}
    12. ],
    13. "bounty_amount": 1200,
    14. "bounty_currency": "CNY",
    15. "started_at": "2026-03-14T10:02:11Z",
    16. "completed_at": "2026-03-14T10:41:37Z",
    17. "status": "submitted"
    18. }

    5. Role-based publishing: who can write, who can review, who can modify

    5.1 Three roles with distinct responsibilities

    • Solver: the subject that executes the task, either a person or an agent instance. Responsible for creating and submitting the log.
    • Reviewer: evaluates the log’s completeness, accuracy, and reproducibility, and gives an approve-or-reject conclusion.
    • Auditor: focuses on process compliance and data integrity; can view all logs and review records, handles procedural revocation and exception disposal, and generally does not take part in reviewing the content of an individual log.

    5.2 Permission matrix

    Operation Solver Reviewer Auditor
    Create and submit a log Own creation Own creation Own creation
    Edit or withdraw own log Only when unreviewed or rejected Only when unreviewed or rejected Only when unreviewed or rejected
    Approve a log Not allowed Allowed Not allowed
    Reject a log Not allowed Allowed Not allowed
    Modify another’s log Not allowed Not allowed Only in approved state, with a reason required
    View all logs Not allowed Allowed Allowed
    Settlement confirmation Not allowed Not allowed Allowed

    5.3 Key principle: separation of duties

    • Separate execution from review: a solver cannot review its own log, and multiple identities of the same subject under one instance should not review each other.
    • Separate review from settlement: settlement should be executed automatically or semi-automatically based on the review conclusion, to avoid manual rewriting of amounts and results.
    • Least privilege: token permissions are bound to the role and scoped to a specific task, and are revoked promptly when the task ends.
    • Leave an audit trail: every state change records the operator, time, before-and-after state, and reason, forming an auditable track.

    In addition, the log body, summary, and artifact content are essentially external input. Whether read by a human or by another agent, they should be treated as untrusted data. When displayed or processed again, they need escaping and allowlist validation to prevent cross-site scripting and to stop maliciously crafted “prompt injection” content from affecting downstream flows.

    6. Review workflow: constrain the log lifecycle with a state machine

    Model the log lifecycle as an explicit state machine:

    1. draft ──submit──> submitted
    2. │ │
    3. approved │ │ rejected
    4. v v
    5. verified rejected ──resubmit after revision──> submitted

    Rules:

    • draft: visible only to the creator, freely editable.
    • submitted: content is frozen and enters the review queue. Reviewers can only give a conclusion, not rewrite the content.
    • rejected: a rejection reason is mandatory; the solver revises and resubmits, forming a new version, while the old version is kept for traceability.
    • verified: becomes a formal “proof of work,” usable for dashboard statistics and the reputation system; if withdrawal is needed, it must be performed by an auditor and the reason recorded.

    Combined with idempotency keys, review time limits, and reminder mechanisms, this avoids duplicate submissions and review backlogs:

    1. from datetime import datetime, timezone
    2. # Transition rules: only the transitions listed here are legal
    3. ALLOWED = {
    4. "draft": {"submitted"},
    5. "submitted": {"verified", "rejected"},
    6. "rejected": {"submitted"}, # resubmit after revision
    7. "verified": set(), # terminal state; withdrawal is handled separately by an auditor
    8. }
    9. def transition(current: str, target: str, actor_role: str) -> None:
    10. """Validate whether a state transition is legal; reject illegal transitions and record an audit event."""
    11. if target not in ALLOWED.get(current, set()):
    12. raise ValueError(f"illegal transition: {current} -> {target}")
    13. # Role constraint: only a reviewer can approve (verify) a log
    14. if target == "verified" and actor_role != "reviewer":
    15. raise PermissionError("only reviewer can verify a log")
    16. def submit_log(log: dict, actor_role: str) -> dict:
    17. """Submit a log: an idempotency key prevents duplicate submissions; if one exists with identical content, return the original result directly."""
    18. idem_key = (log["task_id"], log["agent_id"], log.get("attempt", 1))
    19. existing = store.find_by_idem_key(idem_key) # illustrative: idempotency record lookup
    20. if existing:
    21. return existing
    22. transition(log["status"], "submitted", actor_role)
    23. log["status"] = "submitted"
    24. log["submitted_at"] = datetime.now(timezone.utc).isoformat()
    25. if log["status"] != "submitted": # defensive check, guards against the logic being broken by later edits
    26. raise RuntimeError("status unchanged after transition")
    27. return store.save(log, idem_key=idem_key) # illustrative: persist and associate the idempotency key

    7. Trust and traceability: give every conclusion something to check against

    7.1 Three layers of trust

    1. Trustworthy source: every log must be bound to a real identity and a real task; it cannot be created out of thin air.
    2. Trustworthy content: through a review process with separation of duties, content quality and reproducibility are confirmed by a human.
    3. Trustworthy time: the time a log is produced and the time it is reviewed cannot be tampered with unilaterally.

    7.2 Anchors and attestation

    • Task-ID anchoring: the task ID is issued uniformly by the task side; the publishing service must verify “whether this agent actually took part in that task,” preventing forgery or misattribution.
    • Summary attestation: compute a hash digest by concatenating the log’s key fields in a fixed order, and write it into an append-only, tamper-proof attestation record. Implementation can use the platform’s own audit mechanism or a distributed ledger such as a blockchain; the effect is the same: after the fact, you can verify whether the content has been modified.
    • Complete audit chain: log versions, review conclusions, and settlement records all retain timestamps and operator information, forming a complete chain from task to settlement.

    7.3 The trusted-accumulation flow for a single log

    1. The agent submits a log with its task ID and identity token.
    2. The publishing service verifies the token, permissions, and task ownership, and rejects it if any condition is not met.
    3. A log ID is generated, a content digest is computed, and the digest is written into the attestation record.
    4. The status is set to pending review and it enters the review queue.
    5. After approval, the status becomes verified, and bounty settlement and reputation statistics use it as the basis.

    Note that attestation can only prove that “the content has not been modified since,” not that “the content was correct from the start.” Content correctness still depends on the review mechanism. Only the combination of the two forms a trustworthy proof of work.

    8. Protocols and access: let every runtime environment publish

    Agent runtime environments vary widely: some run in containers, some on personal workstations, and some are wrapped in plugins that only expose a simple programming interface. To let them all connect, the access layer needs to consider the following four points:

    • Multi-protocol compatibility: beyond REST, provide adapters for remote-call-style protocols (such as XML-RPC) to cover runtime environments that can only call simple functions and are not good at constructing complex request headers.
    • Protocol-independent domain logic: core logic such as authentication, authorization, and state validation is decoupled from the protocol; each protocol only does parameter parsing and response-format conversion, avoiding multiple implementations of the same rule.
    • Reliable transport behavior: write requests use idempotency keys; exponential backoff retries are used for timeout and rate-limit errors; tokens are renewed automatically before expiry.
    • Quotas and protection: limit publishing frequency, per-log size, and artifact count per agent instance to prevent abnormal instances from inflating volume or causing storage bloat.
    1. # Take a "remote-call-style protocol" handler as an example; the core logic is shared with the REST API
    2. # The handler signature is illustrative; the actual method names depend on the protocol specification you adopt
    3. def submit_log_handler(token, task_id, log_fields):
    4. identity = authenticate(token) # Authentication: parse and validate the token
    5. log = build_log(task_id, log_fields) # Assembly: isomorphic with task data, fill in server-side fields
    6. authorize(identity, "log:submit", task_id) # Authorization: check role and task ownership
    7. log = submit_log(log, actor_role=identity.role) # Business: the state machine and idempotency are guaranteed by the domain layer
    8. digest = compute_digest(log) # Digest: used for later attestation
    9. proof = anchor(log["log_id"], digest) # Attestation: write into the append-only attestation record
    10. return {
    11. "log_id": log["log_id"],
    12. "status": log["status"],
    13. "digest": digest,
    14. "proof_id": proof.id,
    15. "verify_url": f"/logs/{log['log_id']}" # Return a path rather than a full link, for easier deployment across environments
    16. }

    9. Progress and achievements: make contributions visible, but not gameable

    The log pages shown to agents and users are where the system delivers its value:

    • Task timeline: shows completed tasks, bounty amounts, and review status over time, forming a readable work history.
    • Summary metrics: completion count, approval rate, cumulative bounty, average review time, and more.
    • Skill badges: based on approved logs, aggregate capability tags by task category, for example “award the corresponding badge once the pass rate for code-repair tasks reaches a certain level.”

    Badge rules should meet three points:

    1. Based only on logs that passed review; pending or rejected logs are not counted.
    2. Rules are open and transparent, and levels and thresholds are queryable.
    3. In case of serious violations, the corresponding badge can be revoked.

    The key to progress and achievement design is not to “look good” but to be “countable, explainable, and revocable.”

    10. Engineering implementation and best practices

    10.1 Reference architecture

    • Access layer: a multi-protocol interface layer responsible for authentication, rate limiting, and request validation.
    • Business layer: identity and permission services, log service, review service, and attestation service.
    • Async layer: a message queue handles time-consuming tasks such as review notifications, digest computation, and dashboard statistics, keeping the publishing request from being blocked.
    • Storage layer: structured logs and review records go into a relational database; log bodies and artifacts go into object storage, linked by artifact digest; access logs are collected by a logging service.
    • Infrastructure: services are deployed as containers on a container platform; monitoring and alerting cover key metrics such as publishing failure rate, review backlog, and token anomalies.

    10.2 Choosing cloud resources

    If your team is evaluating building similar capabilities on Baidu AI Cloud, you can map them to general cloud product categories:

    Capability need Candidate general cloud product category
    Storing artifacts and log bodies Object storage
    Async tasks like review notifications and digest computation Message queue
    Deploying the publishing and review services Container platform
    Issuing identity credentials and tokens Identity and authentication services
    Collecting and analyzing runtime logs Logging service
    Monitoring key metrics and alerting on anomalies Monitoring and alerting service

    Selection and configuration of specific products should follow the official documentation and your own business requirements.

    10.3 Seven practical recommendations

    1. Identity first: establish instance-level identity and a least-privilege model before opening up publishing.
    2. Contract first: version the API, fields, and state machine, and evolve the agent side and the platform side in sync.
    3. Append-only: once submitted, log bodies and review records are not rewritten in place; corrections are appended as new versions.
    4. Idempotency and retries: all write interfaces support idempotency keys, and clients are able to retry with backoff.
    5. Content is input: apply security handling to log bodies, summaries, and artifacts to prevent prompt injection from affecting downstream flows.
    6. Observability: build monitoring and alerting for publishing failure rate, review time, and attestation-write latency.
    7. Compliance and privacy: define data ownership and retention periods, mask sensitive information, and make shared scope configurable.

    11. Conclusion

    Competition in agent capabilities is extending from “can it finish a task” to “can the result be trusted afterward.” A well-designed result-accumulation system should do at least four things:

    • Use instance-level identity as the foundation, so publishing never leaves the task environment;
    • Use metadata that is isomorphic with the task as the skeleton, so logs are readable and countable;
    • Use role separation and a state machine as safeguards, so every conclusion is confirmed;
    • Use task-ID anchoring and summary attestation as support, so results are verifiable and traceable.

    When every conclusion can be matched to its task, instance, and review record, an agent truly moves from “able to work” to “trusted with the work.”