Factorik Factorik Start free trial
← See all articles

How to Set Up Your First Factorik Agent

Quick answer: To set up an AI coding agent in Factorik, connect GitHub and choose the repositories it may touch. Add your organization's AI credential, then create one agent with one narrow job, such as repairing a broken default branch or fixing bugs labeled "bug". Give it one trigger and write its standing rules. Protect sensitive paths in the merge policy, keep merges with a person, and promote the agent only once its record earns it.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

What job should your first AI coding agent have?

Your first agent should have one narrow, low-risk job with a clear finish line, such as repairing a broken default branch or fixing bugs someone has labeled. Both jobs start from a concrete signal: a failed job log or a written bug report. Both end in a small pull request a reviewer can judge in minutes. That shape matters more than how clever the agent is. A job like "improve the codebase" gives the agent no stopping point, and it gives you no way to tell a good run from a bad one. A job like "when CI fails on main, find the cause and open a fix" has a clear outcome. Within a day or two you'll know whether it's pulling its weight.

Factorik's presets make the choice easier because each one is already a single job. The CI Fixer agent repairs a broken default branch. On a pull request, it explains what broke instead of changing the code. Bug Fixer diagnoses a reported bug, fixes the cause and proves the fix. Test Writer adds tests for important logic that has none, and Docs Keeper corrects documentation that has drifted from the code. Dependency Updater looks like a natural first agent, but it's a weaker choice than it seems. Dependency manifests are exactly the kind of sensitive path you'll want a person to review anyway, so early on it rarely gets the chance to build a clean record of low-risk merges.

Here's the contrarian part: don't start with the agent that would save you the most time. Start with the one whose mistakes are cheapest and easiest to spot. A wrong docs fix or a weak test costs a few minutes of review. A wrong change to billing code costs far more. It also teaches your team to distrust the whole idea before the agent has had a fair hearing. One agent, one repository, one job is the right first step. Once you've seen how it reads your code, writes its pull requests and handles feedback, adding a second agent is a much easier decision. By then you're judging from evidence instead of a demo.

PresetA sensible first triggerWhat it producesWhy it suits a first agent
CI FixerCI failed on the default branchA fix pull request, or a comment explaining the cause on a pull requestClear signal, small diffs
Bug FixerIssue labeled bugA pull request that fixes the cause and proves itA person picks the work by labeling
Test WriterScheduleA pull request adding testsAdds coverage without changing behavior
Docs KeeperScheduleA pull request correcting docsMistakes are cheap and easy to review
Good candidates for a first agent, with a sensible trigger for each

How do you connect GitHub and your AI credential?

Sign up, then follow the setup guide on the Overview page. It walks you through four steps in order: "Connect GitHub", "Add your AI credential", "Start your first agent" and "Start a run". Each step unlocks the next, so you can't skip ahead and end up with an agent that has nowhere to work. You can sign up with GitHub, or with an email address and the code sent to it. Your first organization starts on the free trial, and teammates can join later through Settings, "Invite a teammate". The whole sequence is quick if you have admin rights on the GitHub organization. If you don't, line up whoever does before you begin, because installing the app is the first step.

"Connect GitHub" installs the Factorik app on your account or organization. This is where you make your first real safety decision: which repositories agents may work on. Pick one. Factorik can't see the repositories you leave out, and you can add more later from Repositories with "Add repositories". Choose a repository with working CI and a decent test suite. Passing checks are how both you and the merge policy tell whether a change holds up. A repository without CI can still host an agent, but then every judgment rests on human review alone. GitHub is the only git host Factorik supports today, so teams whose code lives elsewhere can't use it yet.

Next, an owner adds the organization's own AI provider credential in Settings, choosing the "Kind of credential". It's stored encrypted, and only its last four characters are ever shown again. Runs are billed to that provider account, so the Spend page reflects real money on your own invoice, broken down by agent, model and repository. Until the credential works, runs wait rather than fail, so a typo here won't leave a trail of red runs. Check Spend after the first few runs anyway. It shows you early what a given kind of job costs, while you're running one agent and not five, and that's useful to know before you add more.

Which trigger should wake your first agent?

Pick one trigger that matches the agent's job and nothing else: "CI failed on the default branch" for a CI repair agent, or "Issue labeled" with the label bug for a bug fixer. A trigger is the event that wakes the agent, and for a first agent, fewer is better. Every extra trigger is another way for runs to start when you weren't expecting them, and more noise while you're still learning what normal looks like. You add triggers on the agent form under "Triggers" with "Add trigger". An agent with no trigger runs only when someone starts it by hand, which is a fine way to spend its first afternoon.

The labeled-issue trigger has a quiet advantage over "Issue opened": a person decides what the agent works on. Someone reads the report, judges it real and specific enough, and applies the label. That human filter keeps vague or duplicate issues away from the agent. For CI, you can also turn on "Also when CI fails on a pull request". On someone else's pull request, the agent only comments with the cause and the fix. On its own pull requests, it repairs the branch a limited number of times. For a broader look at issue, mention, schedule, webhook and Slack triggers, see this comparison of what each trigger suits and where it goes wrong.

Two safety settings deserve attention. Issue triggers have an option called "Also for people outside the team", which is off by default. On a public repository, leave it off, or any stranger who opens an issue can start a run. Factorik treats issue and comment text as data, not instructions, but there's no reason to invite that traffic. Second, if you choose a CI repair agent, learn how to tell flaky failures from real ones before you switch it on. An agent chasing a flaky test will open pull requests that fix nothing. This walkthrough on fixing failing CI automatically and safely covers reading the log, finding the cause and keeping the review step.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

How should you write the agent's rules and protected paths?

Write the agent's instructions and rules the way you'd brief a new contractor on day one: what the job is, what done looks like and what's off limits. The form splits this in two. "Instructions" describes the job in plain words. "Rules from the team" are standing rules every run follows. Only people write them, and a run can't rewrite them. Good rules are specific and checkable, such as "Add a regression test that fails before the fix", "Never change public API signatures" or "Keep each pull request to one cause". Vague rules like "write clean code" add words without changing behavior. If you created the agent from the Start page, it also begins with "What it learned about this repository" as its memory.

Next, go to Repositories and open "Merge policy" for the repository. This setting protects you no matter how good the agent turns out to be. Leave "Merge automatically" off, which is the default. Off means every agent pull request waits for a person. Turn on "Require all checks to pass". Add "Protected paths" as glob patterns for code that should always get human eyes: payments, auth, database migrations, deploy configuration and dependency manifests. A pull request that touches any of them waits for a person, whatever level the agent reaches later. Set "Largest change, in files" and "Largest change, in lines" to a size you'd happily review over a cup of coffee.

Last on the form are "Tools" and "Autonomy and limits". Grant only the tools this job needs. A bug fixer may genuinely benefit from Sentry or your logs, while a docs agent needs nothing beyond the repository. Every tool call goes through a gateway that records it, and credentials stay on Factorik's server. Even so, the shortest list is the safest. Under "Autonomy and limits", keep "What it may do without a person" at the first level. Set a sensible "Time limit per run" and keep "Runs at once" low while you're watching closely. For a fuller list of token, trigger and write settings worth checking, work through this security checklist for AI coding agents.

How do you review the first pull requests and decide when to promote?

Treat the first week as an audition. Review every pull request, give feedback on every run, and promote the agent only when its record clears the bar, not when it feels right. Start with "Run now" on the agent page and a small, specific "Task (optional)", such as a known bug or a recent CI failure. Open the run and follow its "Timeline" while it works. When it finishes, check "Changed files", the pull request and the checks. Correctness isn't the only question. Is the change the size you expected? Did it touch anything it shouldn't have? Could a colleague review it from the pull request description alone, without asking anyone for context?

Feedback is how the agent learns what your team wants, so leave it even on good runs. Rate the run and answer "What should it do differently?". If the point applies to every future run, press "Make this a standing rule" and it becomes one of the agent's rules. When you close a pull request you don't want, use "Close pull request" and give a reason, because the agent reads it on its next runs. The Inbox gathers everything waiting on a person, from merges you can approve with "Approve and merge" to blocked runs that need an answer. Mark changes worth checking after merge with "Watch in production". If one goes wrong, use "Report a problem with this change".

Promotion comes from the record, not a hunch. The agent page shows its level, its record of merged changes and what the next level needs: enough merged changes, a high merge rate and no problems traced back to them. When the agent clears the bar, Factorik offers the promotion on that page and in Slack, and a person presses "Promote" or "Not now". At the second level, the agent merges only low-risk changes. Risk is judged from facts like file count, line count, deletions and sensitive paths. Any problem traced to a merged change moves it down a level at once. For the thinking behind letting agents merge on their record, start there. To try it yourself, start the free 7-day Team trial. It needs no payment details.

Frequently asked questions

How long does it take to set up a first AI coding agent?

The form itself is quick. Connecting GitHub, adding the AI credential and saving an agent are short, guided steps on the Overview page. Most of the time goes into decisions: picking the agent's one job, writing a few precise rules and setting protected paths in the merge policy. Plan to spend more time reviewing the first pull requests than on the setup. Those reviews teach you how the agent works, and your feedback teaches it what your team expects.

Can a Factorik agent merge its own pull requests on day one?

No, not unless you deliberately change two things. Auto-merge is off by default in every repository's merge policy, and every agent starts at the first level, where it opens pull requests and a person merges them. It moves up only when its record clears the bar and a person presses "Promote", or automatically if your organization chose that in Settings. Pull requests that touch protected paths always wait for a person.

What happens if the agent can't finish its task?

It ends the run as blocked and explains why under "What the agent needs" on the run page. You can reply with "Your answer", and the agent continues with that information. Never paste a password there. Credentials belong in a connected tool. Blocked runs also show up in the Inbox, so the whole team sees each one in a single place instead of everyone chasing it separately.

Does the Factorik free trial need a credit card?

No. The free 7-day trial of the Team plan needs no payment details. Sign up with GitHub, or with an email address and the code sent to it, and your first organization starts on the trial. Runs use your organization's own AI provider credential, so model usage is billed to that account. The Spend page shows what each agent, model and repository costs while you evaluate.

Let an agent earn its place on your team

Define a Factorik agent once and it wakes on an issue, a failed build or a schedule, works in an isolated sandbox and ships a pull request. It starts with a person merging its work and earns more autonomy on its record. Try it free for 7 days, no payment details needed.

Start your free trial

How helpful was this article?

Articles by Factorik →