[Feature]
Problem
In multi‑agent setups using gitagent, some agents act as orchestrators and regularly delegate work to other agents (for example, a planner delegating to a code‑reviewer or a research agent delegating to a summarizer). Today, gitagent standardizes identity, rules, and compliance in git, but there is no git‑native way for agents to track each other’s performance over time. This makes it harder to:
choose between multiple agents that can do the same task
detect degraded or misbehaving agents early
tie governance decisions (like requiring human review) to observed behavior rather than static config.
In practice, this means I’m often “flying blind” about which agent actually performs better, even though the interaction data exists in the runtime.
Proposed Solution
Standardize an optional, git‑native mechanism for Agent KPIs (Key Performance Indicators) driven by peer feedback between agents:
Feedback log artifact
Path: .gitagent/feedback.log (runtime‑generated, append‑only).
Each entry represents one interaction between a caller agent and a callee agent, with a minimal schema like:
timestamp (ISO8601)
caller_agent, callee_agent (name or repo URL)
interaction_id
task_type (e.g., code_review, research, planning)
accuracy_score (numeric)
completion_status (success, partial, failed, escalated)
latency_ms
policy_violations (count).
Aggregated KPI artifact
Path: .gitagent/kpi.json (runtime‑generated summary per agent).
Example shape:
json { "agent": "code-reviewer", "window": "30d", "metrics": { "total_calls": 124, "success_rate": 0.91, "escalation_rate": 0.05, "avg_accuracy_score": 0.87, "avg_latency_ms": 1520, "violation_rate": 0.02 } } Orchestrators and governance layers can read this to route tasks and enforce guardrails.
Optional kpi_policy in agent.yaml
Let agents declare how they want to be monitored:
text kpi_policy: metrics: - name: accuracy_score min_samples: 20 alert_below: 0.8 - name: escalation_rate min_samples: 20 alert_above: 0.15 - name: violation_rate alert_above: 0.05 windows: default: 30d actions: on_alert: - type: advisory - type: require_human_review The spec defines the schema; runtimes decide what “advisory” or “require_human_review” means in practice.
Standard feedback tool definition
A tool such as tools/agent-feedback.yaml that other agents/runtimes can call after delegation, e.g.:
text name: submit_agent_feedback description: Submit post-task feedback about another agent for KPI tracking. input_schema: type: object properties: callee_agent: type: string interaction_id: type: string task_type: type: string accuracy_score: type: number completion_status: type: string enum: [success, partial, failed, escalated] latency_ms: type: integer policy_violations: type: integer required: [callee_agent, interaction_id, completion_status] The runtime implementation appends to .gitagent/feedback.log and updates .gitagent/kpi.json according to kpi_policy.
This keeps gitagent framework‑agnostic while giving a common, git‑native way to capture and use agent performance data.
Alternatives Considered
Runtime‑only metrics (no git artifacts): Metrics could live solely in the orchestration layer (Prometheus, logs, etc.), but then they are not part of the agent’s git‑native identity and governance story, and can’t be versioned or audited alongside rules and compliance.
Ad‑hoc, per‑framework feedback formats: Each framework (LangGraph, CrewAI, custom orchestrators) could invent its own feedback format, but this fragments the ecosystem and makes it harder to reuse agents across runtimes. A minimal standard in gitagent would give everyone a common denominator.
Static labels / manual ratings in agent.yaml: Manually adding “quality” labels or hand‑curated scores in agent.yaml does not evolve with real‑world behavior and can quickly go stale. It also misses the opportunity to let agents effectively “peer‑review” each other based on actual interactions.
Additional Context
This proposal is meant to be optional and backwards‑compatible: repos can ignore KPIs entirely, and runtimes can choose to implement only parts of it.
I’d be happy to draft:
JSON Schemas under spec/schemas/ for agent-kpi-policy and feedback-event.
A short “Agent KPIs & Peer Feedback” section in docs.md that explains the artifacts and shows how they complement existing Compliance and SOD patterns.
A small example where one agent delegates to another and calls submit_agent_feedback, with sample feedback.log and kpi.json.
Questions for gitagent maintainers:
Does standardizing KPI artifacts like this fit your vision for gitagent’s core spec, or would you prefer it as a documented pattern/extension?
Are .gitagent/feedback.log and .gitagent/kpi.json acceptable paths, or would you prefer a different structure?
Are there existing commands (e.g., gitagent audit) or planned governance features you’d like these KPIs to integrate with?
Apologies for the delay. The proposal is interesting and the underlying problem is real — multi-agent setups today have no protocol-level way to learn which agent in a pool actually does the work well.
Brutally honest: I want to push back on the schema before saying yes.
Where I agree:
- Append-only log, runtime-generated, in
.gitagent/so it's gitignored by default. - Caller→callee identification by name + repo URL is right.
- Tied to an
interaction_idso you can correlate feedback events to the work they describe. - This is the natural git-native counterpart to a centralized observability tool.
Where I'd want changes:
- Don't standardize the score schema yet. v0 should specify the envelope (timestamp, caller, callee, interaction_id, optional
score, optionalscore_schema_uri) and let teams pick their own scoring method by URI. Standardizing a 1–5 scale before two implementations exist would be premature, and we don't yet know whether teams want absolute scores, pairwise rankings, or per-dimension rubrics. - Path:
.gitagent/feedback.jsonl, not.log. Newline-delimited JSON is greppable and tool-friendly;.loginvites unstructured plaintext. - Specify "when to write" semantics. Is it on every interaction? On
post_tool_usehook? On agent decision divergence? The spec should at least define one canonical trigger so two implementations agree. - Privacy. Feedback entries can reveal interaction patterns. Spec should say: do not write user inputs or tool args into
.gitagent/feedback.jsonl— only metadata + scores. Otherwise it becomes a privacy leak by accident.
Path forward:
If you'd like to put up a spec/rfcs/peer-feedback.md covering the envelope, the trigger, and the privacy boundary, that's the smallest version that becomes interop-ready. We can iterate on the score schema after.
Thanks for raising it. The "tie governance to observed behavior, not static config" line is the right framing.
Good problem statement. A few thoughts on design before this moves to implementation:
Tracking signal — what data does an orchestrator agent actually have access to when scoring a downstream agent? If it is purely the content of the final response, that is a weak signal. Consider defining a structured result.yaml or appending to a performance/ log in the delegatee agent directory after each invocation. This gives gitagent something concrete to version and diff.
Misbehavior detection — "degraded or misbehaving" is broad. Worth scoping to a first concrete case: e.g. an agent that exceeds max_turns, fails to produce a required output schema, or violates a compliance rule. Bounded scope makes this implementable without a full ML eval pipeline.
Git-native approach — if performance records live in git (append-only log files or structured YAML per run), gitagent diff (issue #4) could surface regressions automatically. The two features compose well.
Happy to help spec out the schema if you want to push this toward a draft PR.
Good problem statement. A few thoughts on scoping this:
- A git-native reputation/performance store could live as a JSON or YAML file at
.gitagent/performance/{agent-name}.json, committed after each delegation result. This keeps it auditable and versionable without a separate database. - The hardest part is defining what a "performance signal" means across different agent types. A code-reviewer agent and a summarizer agent have very different quality metrics. The spec should define a baseline schema (task completed, latency, error/success) and allow per-agent custom metrics rather than trying to standardize quality upfront.
- For orchestrator-side selection between multiple agents that can handle the same task, the delegation section of agent.yaml is the natural place to express routing preferences. This feature could extend that with a
prefer: highest-scoreorfallbackpolicy.
Assigning @shreyas-lyzr to coordinate next steps.
Thanks — I’ve narrowed the proposal based on the feedback, and I think the cleaner v1 is a git-native performance store plus delegation preferences in agent.yaml, rather than a broader reputation/KPI system.
Proposed scope
- A git-native performance store at
.gitagent/performance/{agent-name}.json, committed after delegation outcomes so performance remains auditable and versionable in git. - A minimal baseline schema for cross-agent signals only, such as total delegations, completed / failed / escalated counts, success rate, average latency, and recent run metadata.
- Optional orchestrator-assigned ratings, where the orchestrator evaluates delegates in context because it knows the eligible delegate set, the delegated task, and each delegate’s role / goal / responsibilities.
- Delegation preferences in
agent.yaml, for exampleprefer: highest-scoreandfallback: ordered, so routing policy stays in the manifest while observations stay in the performance store.
Key scoring rule
The default scoring behavior should be strict and outcome-first.
If an agent had sufficient inputs, permissions, and an eligible execution path, but failed to produce the required usable outcome, the run MUST count as a performance failure.
That should include operationally valid errors such as RATE_LIMIT, TIMEOUT, DEPENDENCY_FAILURE, and RETRY_EXHAUSTED when those conditions prevent the required result from being delivered. These errors may explain why the run failed, but they should not prevent the run from being counted as a failure in performance scoring if the required outcome was not achieved.
Why this shape
This keeps the core spec narrow: baseline metrics are standardized, ratings remain role-aware and extensible, routing policy lives in agent.yaml, and performance history stays git-native and reviewable. It also composes well with future semantic diffing, because structured performance and rating files can become first-class inputs to behavior-level diffs between agent versions.
Spec snippet 1: performance.v1
{
"schema_version": "performance.v1",
"agent_name": "code-reviewer-strict",
"updated_at": "2026-05-25T11:00:00Z",
"baseline": {
"total_delegations": 42,
"completed": 38,
"failed": 3,
"escalated": 1,
"success_rate": 0.9048,
"avg_latency_ms": 1820,
"last_result": "success",
"last_task_type": "code_review",
"last_run_at": "2026-05-25T10:58:00Z"
},
"orchestrator_ratings": {
"rating_scale": "1-5",
"rating_guideline_ref": ".gitagent/ratings/default-orchestrator-rating.yaml",
"average_rating": 4.2,
"last_rating": 5
},
"custom_metrics": {
"review_acceptance_rate": 0.71,
"critical_issues_caught": 12
}
}
This structure keeps universally comparable signals in baseline, lets orchestrators attach contextual ratings, and preserves an extension point for role-specific metrics under custom_metrics.
Spec snippet 2: default-orchestrator-rating.yaml
schema_version: rating-guideline.v1
name: default-orchestrator-rating
applies_to:
task_types: ["*"]
agent_roles: ["*"]
policy:
scoring_mode: outcome_first
require_inputs_sufficient_check: true
require_required_outcome_check: true
mandatory_rules:
- id: sufficient-inputs-no-outcome-is-failure
description: >
If the agent had all required inputs, permissions, and an eligible execution path,
but did not produce the required usable outcome, the run MUST be classified as failure.
effect:
outcome_class: failure
- id: valid-operational-errors-still-failure
description: >
Operationally valid errors such as RATE_LIMIT, TIMEOUT, DEPENDENCY_FAILURE,
RETRY_EXHAUSTED, or TRANSIENT_TOOL_ERROR MUST still count as failure when
the required usable outcome was not achieved.
applies_when:
inputs_sufficient: true
required_outcome_achieved: false
effect:
outcome_class: failure
failure_counts_as_performance_failure: true
- id: handling-quality-does-not-upgrade-outcome
description: >
Good retry behavior, clear reporting, or graceful stop conditions may improve
failure severity scoring, but MUST NOT convert a failed outcome into success or neutral.
effect:
allow_failure_score_band_only: true
outcome_classes:
success:
description: Required usable outcome achieved.
allowed_scores: [4, 5]
partial:
description: Some useful progress achieved, but required outcome not fully achieved.
allowed_scores: [3]
failure:
description: No acceptable usable outcome achieved.
allowed_scores: [1, 2]
escalated:
description: Correct policy-based handoff before unsupported or unsafe continuation.
allowed_scores: [3, 4]
score_bands:
5:
label: excellent_success
requires:
outcome_class: success
criteria:
- Required outcome fully achieved
- Output is high quality and directly usable
- No policy violations
- Efficient execution with no avoidable retries
4:
label: acceptable_success
requires:
outcome_class: success
criteria:
- Required outcome achieved
- Minor quality or efficiency issues allowed
- No material execution failure
3:
label: partial_or_correct_escalation
requires:
outcome_class_in: [partial, escalated]
criteria:
- Useful progress OR correct escalation
- Required end state not fully achieved by the delegate itself
- Behavior remained safe and traceable
2:
label: handled_failure
requires:
outcome_class: failure
criteria:
- Required outcome not achieved
- Failure was clearly surfaced
- Retries or stop conditions were reasonable
- No misleading claim of success
1:
label: poor_failure
requires:
outcome_class: failure
criteria:
- Required outcome not achieved
- Avoidable mistakes, looping, poor retry behavior, or misleading output
- Weak diagnostics or unsafe behavior may be present
failure_reason_codes:
- RATE_LIMIT
- TIMEOUT
- DEPENDENCY_FAILURE
- RETRY_EXHAUSTED
- TRANSIENT_TOOL_ERROR
- INVALID_OUTPUT
- POLICY_VIOLATION
- UNKNOWN
evaluation_flow:
- step: check_inputs_sufficient
- step: check_required_outcome_achieved
- step: apply_mandatory_rules
- step: assign_outcome_class
- step: assign_score_band
- step: record_failure_reason
- step: persist_result
This rubric uses outcome-first evaluation, which is a good fit for production agent evaluation because it ties scoring to whether the agent actually delivered a usable result before considering softer quality dimensions. It also encodes the strict rule that rate limits and timeouts still count as failures when they block the required outcome, which aligns with reliability thinking where such conditions still represent failure from the consumer’s perspective.
Spec snippet 3: agent.yaml
delegation:
tasks:
code_review:
candidates:
- code-reviewer-fast
- code-reviewer-strict
selection:
prefer: highest-score
score_source: ".gitagent/performance/{agent-name}.json"
score_metric: "orchestrator_ratings.average_rating"
fallback: ordered
summarization:
candidates:
- summarizer-short
- summarizer-accurate
selection:
prefer: highest-score
score_source: ".gitagent/performance/{agent-name}.json"
score_metric: "orchestrator_ratings.average_rating"
fallback: ordered
This keeps orchestration policy in the manifest, which is the right place for declaring how an agent should route work across delegates in a GitAgent-style repo. The performance store remains observational, while agent.yaml stays the authoritative source for delegation behavior.
Note on Issue #4
This proposal should also be helpful for Issue #4 (gitagent diff / semantic diff), because structured performance and rating artifacts give a future diff tool machine-readable inputs for behavior-level comparisons across commits. For example, semantic diffing could later summarize changes like success-rate shifts, rating-guideline changes, or routing-policy changes instead of showing only raw line-level text differences.
Does this narrowed v1 shape sound aligned before I draft the concrete schema additions into a PR-level spec update?
@shreyas-lyzr Friendly reminder to review this. Thanks.