Skip to Content
AgentShield
Contributing

Contribution Guidelines

How to propose and submit changes to AgentShield, and the standards a change must meet.

AgentShield is a security control. A change that makes a failure look like an allow is a defect, even when the happy-path tests are green.

Before you open a change

  • Read Architecture and the security model. The originals are docs/ARCHITECTURE.md and docs/SECURITY_MODEL.md.
  • If you move a service boundary, a decision rule, or a storage choice, add or update an ADR in docs/adr/.
  • Keep OpenAPI and the implementation together. If a route is not finished, leave it unregistered and record it in docs/api/README.md. Never return an empty success body for an unimplemented operation.
  • Schema changes are new SQL files under infrastructure/docker/postgres/migrations/, safe to run twice, and listed in the migrations kustomization. Do not add a framework setting that creates tables from classes.

Scope of a pull request

  • Prefer one focused change, ideally one roadmap item.
  • Include tests that fail if the security behavior regresses.
  • Say which checks you ran.
  • Update documentation in apps/docs when behavior, configuration, or APIs change.

Standards

AreaExpectation
Failure handlingErrors fail closed. Never convert an error into allow, never call a tool after an error
TrustTreat agent input as claims. Do not add authority to request body fields
DeterminismAuthorization must not depend on clocks, network calls, or model output
SecretsNever log bodies or tool content; never include secrets in errors; redact before storing
ContractsError envelope error.code, error.message, error.request_id; stable codes
MetricsNo tenant identifiers in labels; label values from fixed sets
Formattinggofmt, Ruff, and tsc --noEmit clean

Documentation changes

The documentation site lives in apps/docs:

  • Pages are MDX in content/docs/. Each folder has a meta.json that orders its pages.
  • Document only behavior that exists in the code. Link the implementing files with the <Sources> component.
  • API reference pages render from docs/api/*.openapi.yaml. Change the contract, not the rendering.
  • Run npm run build and npm run check:links in apps/docs before submitting.

Review

Reviewers check correctness, fail-closed behavior, tests for the security property, contract and ADR updates, and documentation. Expect questions about what happens when each dependency fails.

Was this page helpful?

On this page