Skip to content

feat(server): expand controls list with attachments#228

Draft
abhinav-galileo wants to merge 1 commit into
mainfrom
feature/control-attachments-api
Draft

feat(server): expand controls list with attachments#228
abhinav-galileo wants to merge 1 commit into
mainfrom
feature/control-attachments-api

Conversation

@abhinav-galileo
Copy link
Copy Markdown
Collaborator

@abhinav-galileo abhinav-galileo commented May 19, 2026

Summary

  • add optional include_attachments expansion on GET /api/v1/controls
  • return direct agent associations, policy associations, and target bindings for listed controls
  • regenerate the TypeScript SDK models and controls list request types

Usage

List controls without attachment expansion, preserving the existing lightweight response:

GET /api/v1/controls

List controls with direct agents, policies, and target bindings expanded for each returned control:

GET /api/v1/controls?include_attachments=true

Optionally filter expanded target bindings by opaque target type:

GET /api/v1/controls?include_attachments=true&attachment_target_type=environment

Each expanded control includes:

{
  "attachments": {
    "agents": [{ "agent_name": "example-agent" }],
    "policies": [{ "policy_id": 42 }],
    "targets": [
      {
        "binding_id": 123,
        "target_type": "environment",
        "target_id": "prod",
        "enabled": true
      }
    ]
  }
}

For full target-binding pagination/filtering, callers can continue using GET /api/v1/control-bindings.

Validation

  • uv run pytest server/tests/test_controls_additional.py::test_list_controls_returns_null_attachments_by_default server/tests/test_controls_additional.py::test_list_controls_expands_policy_agent_and_target_attachments -q
  • uv run pytest server/tests/test_controls_additional.py server/tests/test_control_bindings_endpoints.py server/tests/test_services_controls.py -q
  • make openapi-spec-check
  • make sdk-ts-typecheck
  • make sdk-ts-lint
  • make prepush
  • make server-test
  • make sdk-ts-generate-check

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 97.77778% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rver/src/agent_control_server/services/controls.py 96.77% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@abhinav-galileo abhinav-galileo changed the title feat: expand controls list with attachments feat(server): expand controls list with attachments May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant