### CONTRIBUTING # Contributing to Prime Agent Thanks for your interest in contributing to Prime Agent! Prime Agent is developed in public, and we welcome bug reports, feature requests, questions, and other feedback. To keep the project maintainable, public contributions begin in [GitHub Discussions](https://github.com/PrimeIntellect-ai/prime-agent/discussions). With the influx of agent-generated contributions, we do not review unsolicited pull requests or use public Issues as the initial intake queue. While we are open to contributions by agents, you are responsible for your code and must understand how it interacts with the entire project. ## Start with a Discussion Choose the category that best matches what you want to share: - [General discussion or question](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/general) - [Bug report](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/bug-reports) - [Feature request](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/feature-requests) Search existing Discussions before creating a new one. Include enough detail for someone else to understand and reproduce the problem, but do not share API keys, tokens, private prompts, or other sensitive information. For security vulnerabilities, follow [SECURITY.md](SECURITY.md) instead of posting publicly. ## Issues GitHub Issues track work that maintainers have accepted and intend to investigate or implement. A maintainer may create an Issue from a Discussion when the scope is clear and the work fits the roadmap. An existing Issue does not automatically mean that an external pull request is wanted. Wait for a maintainer to invite implementation before starting substantial work. Issues opened by unapproved contributors are automatically closed and redirected to Discussions. To contribute, share interest in Discussions or corresponding issues, and maintainers can invite implementation for requested work. ## Pull Requests and Trusted Contributors Prime Agent runs on user machines and can execute code with the user's permissions. We therefore limit pull requests to maintainers and trusted contributors who have been explicitly vouched for. Maintainers may vouch for someone after they have consistently demonstrated a useful understanding of the project through Discussions, issue investigation, testing, documentation, or other collaboration. There is no separate application process and no guarantee that participation will result in approval. Pull requests from unvouched contributors are automatically closed. If you are interested in contributing code, begin with a Discussion and work with the maintainers on the problem first. ## Preparing an Approved Pull Request If a maintainer has invited a pull request: 1. Keep the change focused on the accepted Issue or Discussion. 2. Follow the repository's development rules and existing conventions. 3. Add or update tests for behavioral changes. 4. Run the relevant checks locally and describe the validation in the pull request. 5. Avoid unrelated refactors or dependency changes. Development setup and commands are documented in the [development guide](packages/coding-agent/docs/development.md). Maintainers may close a pull request that changes scope, cannot be validated safely, or no longer fits the project roadmap. --- ### README

Prime Intellect

Prime Agent: A Self-Improving RLM Agent

DocumentationVerifiersPRIME-RLpi-mono

CI Build Binaries

Prime Agent is an open-source coding and research agent for general and long-running work. It is designed around two core abstractions: - The **[Recursive Language Model (RLM)](https://www.primeintellect.ai/blog/rlm)** treats context as variables (*prompt-as-a-variable*) and tools like recursive subagents as function calls (*programmatic tool /sub-agent calling*) inside a persistent REPL. - The **[Continual Harness](https://arxiv.org/abs/2605.09998)** stores supplemental prompts, memories, skill descriptions, and reusable subagent specifications as durable state that Prime Agent can refine through small, evidence-backed updates, local to the session by default. Prime Agent combines a persistent Python control environment with durable harness state, so useful working context and reusable operating patterns can outlive a single chat window. - **Everything is programmatic:** persistent IPython is the built-in model tool; file operations, shell commands, tool use, subagents, and context management happen through code. - **Subagents are built in:** `rlm(...)` spawns real child agents for parallel or background work and returns their results programmatically. - **The harness can improve:** `/refine` reviews the current trajectory and can apply small, evidence-backed updates to supplemental harness state. It never rewrites the immutable base system prompt, and recorded snapshots support rollback. - **Skills are executable:** skills are importable Python packages, and the built-in skill creator can turn recurring workflows into project or personal skills. - **Sessions run in the background:** daemon-backed agents keep running when the terminal disconnects and can be reattached later. - **Agents communicate directly:** running agents can exchange messages and orchestrate one another without routing everything through the user. - **Long tasks keep moving:** automatic compaction, persistent goals, heartbeats, schedules, autonomous mode, and retained subagents preserve progress across turns and terminal sessions. ## Getting Started Install the latest stable release on macOS or Linux: ```bash curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh ``` The installer downloads a versioned release, verifies its SHA-256 checksum, installs the `prime-agent` command, and can prepare the IPython runtime used by the agent. Start Prime Agent from the repository or directory you want it to work in: ```bash cd /path/to/project prime-agent ``` On first launch, run `/login` to choose a subscription or API-key provider. Prime Agent works in the current directory and can run commands and modify files there. Use a disposable clone, clean worktree, or another checkpoint you can inspect and restore. > [!WARNING] > Prime Agent executes model-generated Python and project commands with your user permissions. Its worker and kernel processes improve lifecycle isolation and recovery; they are **not** a security sandbox. Review changes and use trusted repositories, instructions, skills, and extensions only. Run untrusted code or instructions in an external sandbox or restricted environment. Useful commands: ```bash prime-agent agents # Browse running, idle, and saved sessions prime-agent attach # Reattach to a running session prime-agent --resume [path|id] # Browse sessions or resume one directly prime-agent status # Inspect background service state prime-agent doctor [--fix] # Inspect or repair background services prime-agent update [--force] # Update Prime Agent prime-agent shutdown [--force] # Stop every agent, worker, and background service ``` ## Built for Long-Running Work Prime Agent is built for long-running work, especially for evaluations in research. These features are available in the TUI, and when run autonomously. - **Continual Harness:** `/refine` can persist focused, reviewable lessons as supplemental prompts, memories, reusable skill descriptions, or subagent specifications, with recorded refinement history. It does not replace packaging and reviewing new executable skills. - **Direct agent-to-agent communication:** running agents and retained subagents can discover one another, exchange messages, and steer active work. - **Daemon-backed continuity:** active sessions, IPython state, schedules, and subagents keep running when the terminal detaches and can be reattached later. - **Heartbeats and schedules:** `/heartbeat`, `rlm_heartbeat`, and `prime-agent schedule` can re-enter a session periodically or at a specific time. - **Persistent goals:** `/goal` keeps an objective and its progress active across turns until it is completed, paused, or cleared. - **Bounded autonomous mode:** `/autonomous` continues within configured turn, token, and time budgets and can run user-defined quality gates. A passed gate checks only what that gate verifies; reaching a limit does not imply task success. ## Documentation - [Quickstart](packages/coding-agent/docs/quickstart.md) — install, authenticate, and run a first session - [Usage and CLI reference](packages/coding-agent/docs/usage.md) — commands, sessions, autonomous limits, and output modes - [Long-running and background agents](packages/coding-agent/docs/long-running-agents.md) — detach and reattach, goals, heartbeats, and schedules - [RLM programming model](packages/coding-agent/docs/rlm.md) — persistent IPython, subagents, skills, and the trust model - [JSON mode](packages/coding-agent/docs/json.md) and [RPC mode](packages/coding-agent/docs/rpc.md) — headless automation and integrations - [Skills](packages/coding-agent/docs/skills.md) — install and create reusable capabilities - [Provider setup](packages/coding-agent/docs/providers.md) — subscription and API-key providers - [Architecture overview](packages/coding-agent/docs/architecture.md) — daemon, worker, kernel, and persistence boundaries - [Development](packages/coding-agent/docs/development.md) — build and run from source ## Contributing Start with a GitHub Discussion for [general questions](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/general), [bug reports](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/bug-reports), and [feature requests](https://github.com/PrimeIntellect-ai/prime-agent/discussions/categories/feature-requests). Maintainers promote accepted work into Issues, and pull requests are reviewed from maintainers and vouched contributors. Read the [contribution guidelines](CONTRIBUTING.md) for the full process. Report security vulnerabilities privately by following the [security policy](SECURITY.md). ## Acknowledgements Our agent and TUI is built on top of [`pi`](https://github.com/earendil-works/pi). We thank the authors of `pi` for their valuable work. ## License Prime Agent is fully open source and released under the [MIT License](LICENSE). --- ### SECURITY # Security Policy ## Reporting a Vulnerability Do not report security vulnerabilities through public Issues, Discussions, or pull requests. Send the report to [security@primeintellect.ai](mailto:security@primeintellect.ai). For encrypted communication and the current company-wide disclosure policy, see [primeintellect.ai/security](https://www.primeintellect.ai/security). Include the following when possible: - The affected version or commit - The affected component and environment - Reproduction steps or a minimal proof of concept - The expected and observed impact - Any known mitigations Do not include real API keys, tokens, personal data, or credentials in the report. Use redacted or disposable test values. ## What to Expect Maintainers will assess the report, determine its scope, and coordinate remediation and disclosure when appropriate. Please allow time for investigation before publishing details that could put users at risk. Security fixes are generally prepared against the default branch and released on a schedule chosen by the maintainers. We do not guarantee fixes for older versions. For ordinary bugs, feature requests, and support questions, use [GitHub Discussions](https://github.com/PrimeIntellect-ai/prime-agent/discussions). ---