ForgeLayer

Repository policy intelligence

RepoBrain

Give every AI agent the rules and context of your repository.

Repository-specific policy and context for AI software work.

RepoBrain does not execute agents or modify repositories. It supplies repository-specific policy context to the executable internal policy gate, MergeGuard, and future controlled AgentOS workflows. The current source is deterministic demo policy; no live repository policy file is fetched.

Repository policy binding

Policy context is bound to a recorded preview, not a live GitHub read.

RepoBrain consumes the scenario-owned repository identity and deterministic policy snapshot. Repository contents, forgelayer.yml, branch protection, PRs, and checks were not fetched or observed.

GitHub · repository host

acme-payments/payment-webhook-service

Recorded preview

Secure Payment Webhook · paths are deterministic task scope, not fetched repository contents.

Workspace membership
Workspace Recorded
Adapter
github-repository-adapter · github-repository-adapter-v1
Installation
Installation Unverified
Installation ownership
Installation Ownership Unverified
Repository ownership
Repository Ownership Unverified
Permissions
modeled · unrequested · ungranted · unverified
Metadata / contents
not fetched / not fetched
PR / checks
deterministic previews · not fetched
Webhook
Webhook Not Configured
Revocation / kill switch
Not Revoked / Inactive
Read / write / execution
false / false / false
WorkspaceIdentityTrustWorkspace Recorded
GithubHostTrustHost Recorded
GithubAccountIdentityTrustAccount Unverified
InstallationIdentityTrustInstallation Unverified
InstallationOwnershipTrustInstallation Ownership Unverified
RepositoryIdentityTrustRepository Recorded
RepositoryOwnershipTrustRepository Ownership Unverified
PermissionTrustPermissions Unverified
MetadataTrustMetadata Not Fetched
ContentsTrustContents Not Fetched
WebhookTrustWebhook Not Configured
HealthTrustHealth Not Observed
AdapterVersionTrustAdapter Recorded
PolicyBindingTrustDeterministic Preview
ProductionReadinessProduction Not Ready
Inspect deterministic task paths (2)
  • app/api/payments/webhook.ts
  • tests/payment-webhook.test.ts
Policy snapshotpolicy-snapshot-5cc8bbf1
Policy sourcedeterministic snapshot, not GitHub
Installationunverified
Metadata / contentsnot fetched / not fetched
Live policy verificationfalse
Future requirementauthorized GitHub read

The problem

Generic AI review misses repository intent

The same code change can be routine in one repository and production-critical in another. RepoBrain gives ForgeLayer the paths, tests, reviewers, and approval rules needed to interpret that difference.

Capabilities

Policy context shaped for review

Load forgelayer.yml

Loads repository-owned policy context for an approved review.

Protected paths

Identifies changes to paths that require stronger review controls.

Sensitive paths

Surfaces security-sensitive prompts, auth, payments, webhooks, and migrations.

Required tests

Carries repository-specific test commands and evidence requirements into review.

Required reviewers

Makes code-owner, security, and human reviewer requirements explicit.

Prompt and security review

Requires prompt-safety or security review when repository policy calls for it.

No-auto-merge policy

Preserves repository policy that merge decisions require human control.

Human approval

Surfaces required human approval before work can be trusted or merged.

Repo-specific review context

Explains why a changed path or work type matters in this repository.

Merge recommendation inputs

Provides policy signals to MergeGuard without making an autonomous merge decision.

Rules explorer

Six control categories

Paths

Protected and sensitive repository surfaces.

  • protected_paths
  • sensitive_paths

Testing

Required commands, proof, and regression evidence.

  • test_commands
  • required_rollback_plan

Reviewers

Named review roles and ownership expectations.

  • required_reviewers
  • code-owner

Prompt security

Prompt and security review requirements.

  • required_prompt_review
  • required_security_review

Merge controls

Repository policy controlling merge readiness.

  • auto_merge: false
  • merge recommendation inputs

Approval controls

Human approval and required follow-up gates.

  • required_human_review
  • required_followups

Sample repository policy

forgelayer.yml

version: 1
repo_type: nextjs_checkout_app
protected_paths:
  - app/api/payments/**
  - lib/auth/**
  - db/migrations/**
sensitive_paths:
  - lib/prompts/**
  - app/api/**/webhook.ts
test_commands:
  - npm.cmd test
  - npm.cmd run build
required_reviewers:
  - security
  - code-owner
required_security_review: true
required_prompt_review: true
required_human_review: true
required_rollback_plan: true
auto_merge: false
rules:
  - name: Payment and auth changes require human approval
    paths:
      - app/api/payments/**
      - lib/auth/**
    required_followups:
      - security review
      - tests
      - human approval

Simulated evaluation

#42 Add AI refund assistant prompt and checkout webhook changes

Policy matches

  • app/api/payments/webhook.ts
  • lib/prompts/refund-assistant.ts
  • lib/auth/session.ts
  • tests/refund-assistant.test.ts

Resulting controls

  • Run npm.cmd test and npm.cmd run build.
  • Complete prompt safety review.
  • Complete security review for payment webhook and auth/session changes.
  • Require human approval before merge.
  • Keep automatic merge disabled.

Merge recommendation input: Merge only after required evidence and human approvals are complete.

Safety controls

Policy input, not autonomous action

  • RepoBrain does not execute agents or modify repositories.
  • Repository rules are treated as untrusted policy input and must not contain secrets.
  • Safe summaries do not expose raw repository rules, diffs, tokens, or credentials.
  • GitHub posting and automatic merge remain disabled by default.
  • Generic Platform Guidance: Human approval remains required for protected and sensitive work.