---
title: "Link Governed Agent Route"
method: PUT
path: "/api/v1/discovery/github/agents/{agent_id}/agent"
tags: ["discovery"]
---

# Link Governed Agent Route

`PUT /api/v1/discovery/github/agents/{agent_id}/agent`

The one decision discovery records: which agent governs an agent.
Scans never clear it; a different agent needs an explicit ``replace``.

## Path parameters

- `agent_id` string, uuid, required

## Headers

- `Authorization` string, nullable
- `X-Request-ID` string, nullable

## Request body

- DiscoveryAgentLink — Which agent governs a discovered agent. The link is a decision, not an observation: scans never clear it, and it is never overwritten silently (``replace`` must be explicit).
  - `governed_agent_id` string, uuid, required
  - `replace` boolean

## Response `200`

Successful Response

- DiscoveryAgentRead
  - `id` string, uuid, required
  - `repository_id` string, uuid, required
  - `repository_full_name` string, required
  - `stable_id` string, required
  - `kind` string, required
  - `name` string, required
  - `framework` string, nullable, required
  - `provider` string, nullable, required
  - `model` string, nullable, required
  - `entry_file` string, required
  - `entry_line` integer, nullable, required
  - `gateway_posture` string, required
  - `owner` string, nullable, required
  - `evidence` string[], required
  - `governed_agent_id` string, uuid, nullable, required
  - `first_seen_at` string, date-time, required
  - `last_seen_at` string, date-time, required
  - `removed_at` string, date-time, nullable, required
  - `open_findings` integer, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-27** `b20a3bdd6219` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/xenovia/apis/controlplane/changes/api/v1/discovery/github/agents/:agent_id/agent/put.md)

---

[API](https://skmtc.dev/xenovia/apis/controlplane.md) · [All operations](https://skmtc.dev/xenovia/apis/controlplane/llms.txt) · [OpenAPI document](https://skmtc.dev/xenovia/apis/controlplane/revisions/b20a3bdd6219?raw)
