SentryAgent.ai Developer
d252097f71
feat(phase-3): workstream 1 — Multi-Tenancy
...
Introduces full multi-tenant organization model to AgentIdP:
Schema:
- 6 migrations: organizations + organization_members tables; organization_id FK
added to agents, credentials, audit_logs; PostgreSQL RLS policies on all three
tables; system org seed + backfill
API:
- 6 new /api/v1/organizations endpoints (CRUD + members) gated by admin:orgs scope
- OPA scopes.json updated with 6 new org endpoint → admin:orgs mappings
Implementation:
- OrgRepository, OrgService, OrgController, createOrgsRouter
- OrgContextMiddleware: sets app.organization_id session variable so RLS enforces
per-request org isolation at the database layer
- JWT payload extended with organization_id claim; auth.ts backfills org_system
for backward-compatible tokens
- New error classes: OrgNotFoundError, OrgHasActiveAgentsError, AlreadyMemberError
Tests: 373 passing, 80.64% branch coverage, zero any types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-30 00:29:32 +00:00
SentryAgent.ai Developer
cb7d079ef6
feat(openspec): Phase 3 Enterprise — proposal, design, specs, and tasks
...
Scaffolds the phase-3-enterprise OpenSpec change (proposal only — awaiting CEO
approval before implementation). 6 workstreams, 95 implementation tasks:
WS1: Multi-Tenancy (21 tasks) — org model, RLS, admin API
WS2: W3C DIDs (12 tasks) — DID:WEB, agent DID documents, AGNTCY cards
WS3: OIDC (12 tasks) — oidc-provider, ID tokens, JWKS, discovery
WS4: Federation (11 tasks) — cross-instance trust, JWT assertions
WS5: Webhooks (17 tasks) — subscriptions, Bull queue, HMAC, retry
WS6: SOC2 (22 tasks) — encryption at rest, Merkle audit chain, controls
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-29 12:53:31 +00:00
SentryAgent.ai Developer
d42c653eea
chore(openspec): archive engineering-docs and phase-2-production-ready changes
...
- engineering-docs → archive/2026-03-29-engineering-docs (63/63 tasks complete)
- phase-2-production-ready → archive/2026-03-29-phase-2-production-ready (89/89 tasks complete)
- openspec/specs/ synced with all Phase 1 + Phase 2 + engineering-docs capabilities (22 specs total)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-29 12:41:53 +00:00
SentryAgent.ai Developer
eced5f8699
docs: engineering knowledge base for new hires
...
Complete docs/engineering/ suite — 12 documents covering company overview,
system architecture, tech stack ADRs, codebase structure, service deep dives,
annotated code walkthroughs, dev setup, engineering workflow, testing strategy,
deployment/ops, SDK guide, and README index. All content verified against
source files. All 82 tasks in openspec/changes/engineering-docs/tasks.md
marked complete.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-29 12:38:42 +00:00
SentryAgent.ai Developer
6913d62648
feat(phase-2): workstream 8 — Multi-Region Terraform Deployment
...
AWS environment:
- VPC (3-AZ, public + private subnets, NAT gateways, VPC endpoints for ECR/SM/CW)
- ECS Fargate service (sentryagent/agentidp) — secrets from Secrets Manager
- RDS PostgreSQL 14 (Multi-AZ, encrypted, VPC-internal, storage autoscaling)
- ElastiCache Redis 7 (primary + replica, at-rest + in-transit encryption)
- ALB with HTTPS/443, HTTP→HTTPS redirect, ACM certificate
- Route 53 alias record
GCP environment:
- VPC + private services access + Serverless VPC connector
- Cloud Run service — secrets from Secret Manager
- Cloud SQL PostgreSQL 14 (private IP, no public endpoint)
- Cloud Memorystore Redis 7 (VPC-internal, AUTH enabled)
Shared:
- 4 reusable modules: agentidp (dual AWS/GCP), rds, redis, lb
- No hardcoded secrets; all sensitive vars marked sensitive=true
- terraform.tfvars.example for both environments
- docs/devops/deployment.md — AWS + GCP step-by-step walkthrough, rollback procedures
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-29 06:25:14 +00:00
SentryAgent.ai Developer
a504964e5f
feat(phase-2): workstream 7 — Prometheus + Grafana Monitoring
...
- Add prom-client 15; shared registry in src/metrics/registry.ts (7 metrics)
- HTTP request counter + duration histogram via metricsMiddleware
- DB query duration histogram wrapping pg Pool.query
- Redis command duration histogram via typed instrumentRedisMethod wrapper
- agentidp_tokens_issued_total in OAuth2Service
- agentidp_agents_registered_total in AgentService
- GET /metrics unauthenticated endpoint (Prometheus text format)
- docker-compose.monitoring.yml overlay (Prometheus + Grafana)
- Grafana auto-provisioned datasource + pre-built AgentIdP dashboard
- docs/devops/operations.md monitoring section added
- 36/36 unit tests passing, 100% coverage on new metrics code
- Fix pre-existing unused import in tests/integration/agents.test.ts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-29 06:13:41 +00:00
SentryAgent.ai Developer
7d6e248a14
feat(phase-2): workstream 6 — Web Dashboard UI
...
- dashboard/: Vite 5 + React 18 + TypeScript strict SPA
- Auth: sessionStorage credentials, TokenManager validation, AuthProvider context
- Pages: Login, Agents (search + filter), AgentDetail (suspend/reactivate),
Credentials (generate/rotate/revoke, new secret shown once),
AuditLog (filters + pagination), Health (PG + Redis status, 30s refresh)
- Components: Button, Badge, ConfirmDialog, AppShell, RequireAuth
- All destructive actions gated by ConfirmDialog
- Zero dangerouslySetInnerHTML; sessionStorage only (OWASP compliant)
- src/routes/health.ts: unauthenticated GET /health — PG + Redis connectivity
- src/app.ts: health route + dashboard/dist/ served at /dashboard with SPA fallback
- 6 new health route tests; 308/308 unit tests passing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 23:19:18 +00:00
SentryAgent.ai Developer
7328a61c44
feat(phase-2): workstream 5 — OPA Policy Engine
...
- policies/authz.rego: Rego policy with path normalisation and scope enforcement
- policies/data/scopes.json: all 13 endpoint → scope mappings
- src/middleware/opa.ts: OpaMiddleware with Wasm primary path + scopes.json fallback;
exports createOpaMiddleware() and reloadOpaPolicy() for SIGHUP hot-reload
- All four route files: opaMiddleware wired after authMiddleware
- AuditController, OAuth2Service: manual scope checks removed (now centralised in OPA)
- src/server.ts: SIGHUP handler calls reloadOpaPolicy()
- docs/devops/environment-variables.md: POLICY_DIR documented
- 38 new tests; 302/302 passing; opa.ts coverage 98.66% statements
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 23:02:11 +00:00
SentryAgent.ai Developer
8cdab72fea
feat: Phase 2 Workstream 4 — Java SDK (ai.sentryagent:idp-sdk)
...
Java 17 SDK in sdk-java/:
- AgentIdPClient composing AgentRegistryClient, CredentialClient,
TokenClient, AuditClient — all 14 endpoints covered
- Both sync methods and CompletableFuture<T> async counterparts on each client
- Thread-safe TokenManager (synchronized) with 60s refresh buffer
- AgentIdPException (extends RuntimeException) with Code/HTTPStatus/Details
- Builder pattern for all request types; Jackson 2.17 for JSON
- Zero external HTTP dependencies — java.net.http.HttpClient (Java 11+)
- No-dep JDK HttpServer used for unit tests (no WireMock needed)
- mvn verify: 49/49 tests passed | JaCoCo coverage gate: >80% ✓
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 15:33:53 +00:00
SentryAgent.ai Developer
91c759f455
feat: Phase 2 Workstream 3 — Go SDK (github.com/sentryagent/idp-sdk-go)
...
Single-package agentidp SDK in sdk-go/:
- AgentIdPClient composing AgentRegistryClient, CredentialClient,
TokenServiceClient, AuditClient — all 14 endpoints covered
- Goroutine-safe TokenManager (sync.Mutex) with 60s refresh buffer
- AgentIdPError implementing error interface with Code/HTTPStatus/Details
- Context-aware: all service methods take context.Context as first arg
- doRequest shared helper; token endpoints use form-encoded POST directly
- go vet: 0 warnings | staticcheck: 0 warnings
- go test ./...: 37/37 passed | coverage: 81.0% (>80% gate)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 15:23:02 +00:00
SentryAgent.ai Developer
c93562e685
feat(phase-2): workstream 2 — Python SDK (sentryagent-idp)
...
Sync (requests) and async (httpx) clients with identical API surface
to the Node.js SDK.
Delivered:
- pyproject.toml — python>=3.9, hatchling build, mypy strict config
- types.py — all 14-endpoint request/response dataclasses
- errors.py — AgentIdPError with from_api_error, from_oauth2_error, network_error
- token_manager.py — thread-safe sync TokenManager, 60s refresh buffer
- async_token_manager.py — asyncio-safe AsyncTokenManager (httpx)
- _request.py — shared sync/async request helper (DRY)
- services/agents.py — AgentRegistryClient + AsyncAgentRegistryClient (5 methods each)
- services/credentials.py — CredentialClient + AsyncCredentialClient (4 methods each)
- services/token.py — TokenClient + AsyncTokenClient (introspect + revoke)
- services/audit.py — AuditClient + AsyncAuditClient (query + get)
- client.py — AgentIdPClient + AsyncAgentIdPClient
- __init__.py — barrel exports
- README.md — installation, quick start, full API reference
QA gates:
- mypy --strict: 0 errors (12 source files)
- pytest: 57/57 passed
- Coverage: 90.83% (required >= 80%)
- All 14 endpoints covered (sync + async)
- AgentIdPError raised on all failure paths
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 15:11:27 +00:00
SentryAgent.ai Developer
90a4addb21
feat(phase-2): workstream 1 — HashiCorp Vault credential storage
...
Vault is optional — server falls back to bcrypt (Phase 1 behaviour)
when VAULT_ADDR is not set. Full coexistence: existing bcrypt credentials
continue to work until rotated.
Changes:
- src/vault/VaultClient.ts — wraps node-vault KV v2; writeSecret,
readSecret, verifySecret (constant-time), deleteSecret
- src/db/migrations/005_add_vault_path.sql — vault_path column on credentials
- CredentialRepository — createWithVaultPath, updateVaultPath methods
- CredentialService — routes generate/rotate through Vault when configured;
bcrypt path unchanged
- OAuth2Service — verifies via Vault when vaultPath set, bcrypt otherwise
- src/app.ts — createVaultClientFromEnv() wired into service layer
- ICredentialRow — vaultPath field added
- docs/devops/environment-variables.md — VAULT_ADDR, VAULT_TOKEN, VAULT_MOUNT
- docs/devops/vault-setup.md — dev quickstart, production config, migration guide
- tests: 33/33 unit tests pass (VaultClient + CredentialService Vault path)
- node-vault + @types/node-vault installed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 15:02:33 +00:00
SentryAgent.ai Developer
7593bfe1c1
chore: Phase 2 OpenSpec scoping — proposal, design, specs, tasks
...
8 workstreams scoped per OpenSpec standards:
1. HashiCorp Vault integration (secret management)
2. Python SDK (sentryagent-idp)
3. Go SDK (idp-sdk-go)
4. Java SDK (ai.sentryagent:idp-sdk)
5. OPA policy engine (dynamic ABAC, hot-reload Rego)
6. Web Dashboard UI (React 18 + TypeScript)
7. Prometheus + Grafana monitoring (7 metrics, pre-built dashboard)
8. Multi-region Terraform deployment (AWS + GCP)
Status: proposed — awaiting CEO dependency approvals (A0.1–A0.5)
before any implementation begins.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 14:53:09 +00:00
SentryAgent.ai Developer
0d56895fae
chore: archive Phase 1 P1 OpenSpec changes
...
Archive dockerfile, agntcy-alignment-docs, and nodejs-sdk changes
now that implementation is complete and pushed to develop.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 14:47:12 +00:00
SentryAgent.ai Developer
aa5167835e
feat: Phase 1 P1 — Dockerfile, AGNTCY alignment docs, Node.js SDK
...
Three remaining Phase 1 P1 deliverables:
1. Dockerfile — multi-stage build (builder + production), node:18-alpine,
non-root USER node, .dockerignore excluding secrets and dev artifacts
2. AGNTCY alignment docs (docs/agntcy/) — README and alignment.md mapping
all 6 AGNTCY domains to AgentIdP features with Phase 2/3 pending items noted
3. Node.js SDK (@sentryagent/idp-sdk) — TypeScript strict, zero any, native
fetch (Node 18+), TokenManager with 60s auto-refresh, service clients for
all 14 endpoints (agents, credentials, tokens, audit), AgentIdPError typed
error hierarchy, full README
All three changes tracked under openspec/changes/ with tasks marked complete.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 14:46:53 +00:00
SentryAgent.ai Developer
d94a8cedc0
docs: DevOps documentation — complete docs/devops/ set
...
Adds the full devops-documentation OpenSpec change implementation.
Separate from docs/developers/ — serves a different audience (operators,
not API consumers).
docs/devops/:
- README.md — index and system overview
- architecture.md — components, ports, data flow, Redis key patterns
- environment-variables.md — all 7 env vars (required + optional, formats, .env example)
- database.md — 4-table schema, indexes, constraints, migration runner
- local-development.md — docker-compose setup, health checks, startup, Dockerfile gap noted
- security.md — RSA key generation/rotation, CORS, bcrypt, secret storage guidance
- operations.md — startup order, graceful shutdown, log reference, troubleshooting
QA gates: 48/48 tasks complete. All env vars verified against source.
All table names verified against migrations. All ports verified against
docker-compose.yml. All internal links resolve.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 14:28:55 +00:00
SentryAgent.ai Developer
61ea975c79
docs: bedroom developer documentation — complete docs/developers/ set
...
Adds the full bedroom-developer-docs OpenSpec change implementation:
- docs/developers/README.md — index page
- docs/developers/quick-start.md — bootstrap to working token in 7 steps
- docs/developers/concepts.md — AgentIdP, AGNTCY, lifecycle, OAuth 2.0, free tier
- docs/developers/guides/README.md — guide index
- docs/developers/guides/register-an-agent.md — all fields, validation, common errors
- docs/developers/guides/manage-credentials.md — generate, list, rotate, revoke
- docs/developers/guides/issue-and-revoke-tokens.md — OAuth 2.0 flow, introspect, revoke
- docs/developers/guides/query-audit-logs.md — filters, pagination, 90-day retention
- docs/developers/api-reference.md — all 14 endpoints, all error codes, curl examples
Also commits deferred OpenSpec housekeeping from previous session:
- Archives phase-1-mvp-implementation change to openspec/changes/archive/
- Adds bedroom-developer-docs change artifacts (30/30 tasks complete)
- Syncs 4 delta specs to openspec/specs/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 14:13:03 +00:00
SentryAgent.ai Developer
d3530285b9
feat: Phase 1 MVP — complete AgentIdP implementation
...
Implements all P0 features per OpenSpec change phase-1-mvp-implementation:
- Agent Registry Service (CRUD) — full lifecycle management
- OAuth 2.0 Token Service (Client Credentials flow)
- Credential Management (generate, rotate, revoke)
- Immutable Audit Log Service
Tech: Node.js 18+, TypeScript 5.3+ strict, Express 4.18+, PostgreSQL 14+, Redis 7+
Standards: OpenAPI 3.0 specs, DRY/SOLID, zero `any` types
Quality: 18 unit test suites, 244 tests passing, 97%+ coverage
OpenAPI: 4 complete specs (14 endpoints total)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-03-28 09:14:41 +00:00