
Agents library
Manage your agents from the Agents library.Creating custom agents
To create an agent, open the Agents library and click Add agent. To start from a popular or suggested agent, click Enable agent (the + button) on its card. Each custom agent includes:-
A Name
A concise title, like “Prevent N+1 Queries” or “Require Sentry Error Handling.” -
A Description
A clear, natural-language instruction the AI will use, such as “Flag code that may cause multiple database calls inside loops.” -
Linked instruction files
For repository-specific agents, open Advanced and enter one repo-relative path per line, such as
docs/style-guide.mdor.cubic/review-agent.md. You can use linked files together with text instructions. You can also define linked files incubic.yamlwith afile_pathslist. cubic reads those files from the pull request head commit when the review runs, so updates to the file apply to future reviews without editing the agent. CLI reviews readcubic.yamland linked files from the repository’s default branch, so changes apply to CLI reviews once they are merged. File-backed agents are best when your team already maintains detailed style, framework, or architecture rules in the repository. General context files help cubic understand the codebase, but custom agents are the right place for checks you want cubic to actively flag.The agent text and linked files share one 10,000 character limit. cubic uses the first 10,000 characters and ignores the rest. Agents you add in the Agents library are text-only. To link files, add the agent in a repository’s Custom agents tab or incubic.yaml. -
Optional Path Filters
Use Glob patterns to limit where the agent applies (or exclude certain paths). This is especially helpful for monorepos, where different directories often require different agents. For example:
- Include:
backend/**to apply the agent only to files under abackendfolder. - Exclude:
!tests/**to ignore test files and focus on production code.
- Include:
- Repositories Choose where the agent runs under Apply to repositories. See Choose which repositories an agent runs on.

Agent attribution in comments
When a custom agent flags an issue, the review comment will indicate which agent triggered it. This helps you understand which agents are working and allows you to iterate on your agent instructions over time.
Choose which repositories an agent runs on
An agent you add in the Agents library runs on every repository by default, including repositories added later. To change that, use Apply to repositories in the agent dialog:- Skip some repositories: uncheck them under All repositories. The agent still runs on every other repository, including new ones.
- Run on only some repositories: uncheck All repositories, then check the repositories that should run the agent.
- Match by name: type a pattern such as
web-*, then choose Only repositories matching or Skip repositories matching. The pattern also applies to repositories created later.
only_repositories and exclude_repositories in cubic.yaml. When the scope includes a pattern, the dialog shows how many repositories it matches, such as “Runs on 9 of 44 repositories, plus new ones that match web-*.”
Managing agents across repositories
Each agent’s card in the Agents library shows where the agent runs and how many repositories run it. Changes to the agent apply to every repository it runs on. From the card’s menu, Turn off everywhere pauses the agent and keeps its settings, and Delete agent removes it from every repository. In a repository’s Custom agents tab, these agents are read-only and labeled Agents library. Edit them in the Agents library. Agents saved as one copy per repository, such as agents added in a repository’s Custom agents tab, keep the repository list when you edit them, and you can turn them on or off for each repository.When a repository reaches its agent limit
Each repository runs agents up to its agent limit, in this order:- Agents from
cubic.yaml. - Agents saved for that repository, newest first.
- Agents from the Agents library, oldest first, so a new agent never takes the place of an older one.
Limitations
- Agent limit: The standard limit is 5 enabled custom agents per repository, or 15 on plans that include codebase scans, such as Pro and Max. Some organizations have a higher limit. The Agents library allows you to define more agents, but only up to your limit can be active per repository. See When a repository reaches its agent limit for which agents run.
- Instruction length: Text instructions and resolved file instructions use the same 10,000 character limit per custom agent. cubic concatenates the text and files in order and uses only the first 10,000 characters; the rest is not included in the review prompt. The dashboard shows how many characters are left or truncated before you save.
- File paths: File-backed agents accept repo-relative file paths only. Absolute paths, globs, parent-directory traversal, directories, binary files, and unreadable files are rejected or shown as warnings. Markdown and YAML files are read as plain text; cubic does not parse them as structured rule definitions.
- Potential false positives: Occasionally, the AI might incorrectly flag or overlook certain scenarios. Consider AI feedback as helpful guidance rather than definitive judgments.
Tips for effective custom agents
- Describe the code to flag and explain why it matters. Include examples when the rule is easy to misinterpret.
- Combine related checks when they share the same scope.
- Use path filters to keep rules relevant to the files being reviewed.
- Focus on checks that linters do not cover, such as business logic and team-specific conventions.
Next steps
- Agents library: Explore community agents and manage your custom agents across repositories.
- AI review settings: Configure AI review behavior for your repositories.
- Introduction: Understand how cubic reviews pull requests by default.