Factory.ai

AI Coding Agents

Software Supply Chain

Safer dependency updates with coding agents

September 24, 2026 - 2 minute read

AI dependency updates become useful when the coding agent owns the compatibility work around a version change. A package bot can open a pull request, but a major upgrade may also require API migrations, configuration changes, generated files, and focused regression tests.

GitHub's Dependabot documentation describes automated pull requests for keeping dependencies current. A coding agent can take the next step by reading the upstream migration guidance, applying the required edits, and producing evidence that the application still behaves correctly.

Scope dependency updates

Start with one dependency family and one stated target version. Capture why the update exists, such as a vulnerability fix, end-of-support deadline, platform requirement, or planned feature. Avoid mixing unrelated upgrades because reviewers lose the ability to connect a failure to one change.

Inspect the manifest and lockfile before editing. Identify direct and transitive changes, package-manager overrides, peer requirements, runtime constraints, and native build steps. Read release notes from the package maintainer. If the release notes do not explain a breaking change, stop rather than asking the agent to infer a migration.

Give the coding agent explicit completion evidence:

  1. The intended package reaches the target version.
  2. The lockfile contains no unexpected source or registry changes.
  3. Deprecated APIs are removed where the upgrade requires it.
  4. Focused tests cover the changed integration points.
  5. The normal type, lint, test, and build gates pass.

Keep dependency updates reviewable

Separate mechanical edits from behavioral changes when possible. A lockfile-only security patch can remain small. A framework major upgrade should explain changed runtime behavior and point reviewers to the files where compatibility decisions were made.

Treat install scripts and new transitive packages as code execution risk. Review changes to registries, resolved URLs, package names, checksums, and lifecycle scripts. The supply-chain threat model provides a useful reference for reasoning about build inputs and supply-chain tampering.

Factory's Droid Exec can run a bounded upgrade in a dedicated working directory or isolated worktree. Its non-interactive mode returns a nonzero exit code on failure, which lets CI reject incomplete migrations rather than treating partial edits as success.

Add agent checks to the existing update flow

Keep established package alerts and update bots as the intake layer. Trigger a coding-agent task only when the repository needs migration work or deeper validation. This preserves the vendor's vulnerability and version data while adding repository-specific execution.

Factory Automations can start work from a schedule or GitHub event. The prompt should name the dependency, allowed files, authoritative release notes, required checks, and whether a remote pull request is authorized. Run the automation as a service account with only the repository permissions it needs.

Do not let the agent merge its own update. Branch protection and human review remain the decision boundary. A small diff, cited upstream guidance, and repeatable checks make AI dependency updates easier to evaluate than a broad batch with an unexplained green check.

Further reading

Ready to build the software of the future?

Start building

Arrow Right Icon