> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenovia.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> Find the agents, model calls and MCP servers in your repositories. Read-only.

Find every agent and model call in your code. Xenovia scans the repositories you choose, read-only, and lists what it finds in [Discovery](https://docs.xenovia.io/discovery/overview.md), with what is risky about each.

For example, a scan finds a support agent that calls OpenAI directly with a key written into the code. Discovery shows it with **Not governed by Xenovia** and **Provider key in code**, and Xenovia writes a setup to bring it under an agent.

The integration installs the Xenovia GitHub App on your GitHub organization or account. Xenovia never writes to your repositories. A linked repository is also what [Simulation](https://docs.xenovia.io/simulation.md) reads to build a copy of your agent.

## Before you start

* You need to be an admin of your Xenovia organization.
* On GitHub, you need to be able to install a GitHub App on the account that owns the repositories.
* One GitHub installation per Xenovia organization. To switch to another installation, disconnect the current one first.

The app asks GitHub for read access to repository **contents** and **metadata**, and receives installation, repository and push events. Each scan uses a token that lasts one hour, can only read, and covers only the repository being scanned. Xenovia never stores it.

## Connect GitHub

**1. Start**

In first-run setup, choose **Find agents in your code**, then **Install on GitHub**. Or open **Settings › Integrations**, find **GitHub** under **Code**, choose **Connect**, then **Continue to GitHub**.

**2. Install the app**

On GitHub, pick the account and choose the repositories Xenovia may read: all of them, or a selection. GitHub then asks you to authorize Xenovia, which lets Xenovia confirm that you can see the installation.

**3. Back in Xenovia**

GitHub sends you back to the GitHub integration page. Xenovia lists the repositories and starts scanning them.

![Find agents in your code dialog saying GitHub is connected, with Finish later, Back and Review what was found](https://mintcdn.com/xenovia/nPa4jXf3_xyZJ59s/images/screens/github-find-agents.png?fit=max\&auto=format\&n=nPa4jXf3_xyZJ59s\&q=85\&s=c340c72c4e8fa1939047cf5b22d8569e)

Find agents in your code, once GitHub is connected

## What Xenovia reads, and when

The integration page lists your repositories under **Repositories**, with each one's visibility, default branch and when it was last scanned. Turn **Scan** off for a repository to leave it out.

A repository is scanned when you connect GitHub; on every push to its default branch, at the pushed commit; when you choose **Sync now** on the integration page, which also lists the repositories again; and when you choose **Scan now** in Discovery. Pushes to other branches don't start a scan. Archived repositories aren't scanned.

A scan reads dependency manifests and configuration files first, then the source files most likely to hold an agent. It reads up to 200 files per repository, each up to 256 KB. It skips vendored, generated and test directories, and never reads lock files. When a scan hits its limits, the entry's **Scan coverage** says **Truncated**. Scans and setups use AI credits; while your organization has none left, they don't run.

## What a scan reports

Each agent, LLM integration, MCP server and MCP client the scan finds is an entry. Its findings include:

| Finding | What it means |
| - | - |
| Not governed by Xenovia | The code calls a model provider directly, not through Xenovia |
| Provider key in code | A secret is written into the code or an MCP server's configuration. The excerpt is withheld |
| Autonomy bypass | Approvals are turned off, for example an MCP server's `alwaysAllow` or `autoApprove` list, Codex's `approval_policy = "never"` or `sandbox_mode = "danger-full-access"`, or `permission_mode="bypassPermissions"` |
| Dangerous tool grant | The agent gets a shell or code-execution tool, or an `allow_dangerous_*` option set to `True` |
| Model output reaches a sink | Model output is passed to `eval`, `exec`, or an OS or subprocess call |
| Unpinned MCP package | An MCP server is started from a package without a pinned version, or installed by piping a download into a shell |
| Unverified MCP remote | An MCP server is reached at a remote URL |
| Unauthenticated agent surface | An A2A agent card declares no security schemes |
| Unpinned model | The model name isn't pinned to a version |

An agent found in code has its own page with two tabs: **Overview** (what it is, its source, owner, framework, provider and model, the tools seen in its code, and the linked Xenovia agent) and **Set up in Xenovia**.

## From code to a governed agent

After each scan, Xenovia reads the code of every agent whose code changed and writes a setup for it. If an agent has none yet, an admin can choose **Plan the setup**.

The **Set up in Xenovia** tab shows what Xenovia will create: the agent and its model provider, a purpose and capabilities, policies, guardrails, alert rules, hosted tools and MCP servers, the agents it calls, backup models, and [Neon](https://docs.xenovia.io/control/neon.md) protections. Each part says which findings it answers. Findings that only a code change can fix are listed under **Fix in your code**.

**1. Apply the setup**

Choose **Create agent**, or **Apply** when the entry is already linked to a Xenovia agent. Xenovia creates everything in the setup in the plan's mode, shown on each part. The mode is monitor unless the plan says otherwise: Xenovia records what it would block, without blocking. Something a person already changed on the agent is kept. The agent goes live once it has an API key; if it has none yet, create one on the agent's page and apply again.

**2. Route the agent through Xenovia**

Nothing changes for the running agent until its code calls Xenovia. Point its base URL at the endpoint shown under **Linked agent** on the **Overview** tab. See [Connect your app](https://docs.xenovia.io/agents/connect-your-app.md).

**3. Confirm and tighten**

Push the change. Once the scan of that push sees the code calling Xenovia, the **Not governed by Xenovia** finding is resolved. Watch the agent in [Sessions](https://docs.xenovia.io/observability/sessions.md), then switch its checks and policies to enforce when you're ready.

If a later scan changes the agent, the entry shows **Changes suggested** and the setup shows what changed. Apply again to bring the Xenovia agent up to date.

## Changes you make on GitHub

| On GitHub | In Xenovia |
| - | - |
| Add or remove repositories from the installation | The repository list follows |
| Delete or archive a repository | It leaves the list, or is marked **Archived** |
| Suspend the app | The integration shows **Needs attention** with "GitHub suspended the installation" until you unsuspend it |
| Uninstall the app | The integration is disconnected |

## Disconnect

Choose **Disconnect** on the GitHub integration page. Xenovia forgets the installation and stops scanning. What only GitHub reported leaves Discovery, and its open findings are resolved. Reviews and the Xenovia agents linked to discovered code stay. The app stays installed on GitHub until you uninstall it there. If you connect the same installation again, Xenovia takes its repositories back and scans them again.

## Troubleshooting

> [accordion] Messages when connecting fails
>
> | Message | Why, and what to do |
> | - | - |
> | Only an organization admin can connect this for the organization. | You aren't an admin of this Xenovia organization, or the installation is already connected to another Xenovia organization you don't administer and GitHub didn't confirm your access. Ask an admin, or start again and authorize Xenovia when GitHub asks |
> | A different installation is already connected, or this link was already used. Disconnect first, then start again. | Your organization already has another installation, or you reused an old link. Disconnect the current one, or start again from **Connect** |
> | The installation was not accepted, or it is not visible to you. Start again from Connect. | GitHub didn't confirm that your GitHub account can see the installation, or the installation is suspended or doesn't grant read access to contents. Check the app on GitHub, then start again |
> | This organization does not know that installation. Start again from Connect. | Start again from **Connect** |
> | This environment has no app registered for it yet. Ask your Xenovia administrator. | GitHub isn't available on this deployment |

> [accordion] After connecting
>
> | You see | What to do |
> | - | - |
> | **Needs attention** with "GitHub suspended the installation" | Unsuspend the app in your GitHub settings |
> | *N* repositories failed. Check GitHub access. | Those repositories left the installation, or the app lost access to them. Check the installation's repository access on GitHub, then choose **Sync now** |

## What next?

> [card] [Connect your app](https://docs.xenovia.io/agents/connect-your-app.md)
>
> Route a found agent through Xenovia.

> [card] [More sources](https://docs.xenovia.io/discovery/integrations.md)
>
> Add identity and device integrations.

> [card] [Simulation](https://docs.xenovia.io/simulation.md)
>
> Test a copy of an agent built from its code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.