Skip to content

Playground#45

Merged
Iamsdt merged 8 commits into
mainfrom
playground
Jul 21, 2026
Merged

Playground#45
Iamsdt merged 8 commits into
mainfrom
playground

Conversation

@Iamsdt

@Iamsdt Iamsdt commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and new features to the CLI, configuration, and documentation for agentflow, with an emphasis on production-readiness, secure-by-default authorization, and enhanced deployment tooling. The most significant changes are the addition of a scalable, cache-backed object-level authorization system (ownership-based), new Kubernetes manifest generation, improved Dockerfile defaults, and safer config file handling in the CLI.

Authorization and Security Enhancements:

  • Designed and implemented a scalable, cache-backed object-level authorization system enforcing owner-only access to threads, with a cache hierarchy (in-process LRU and optional Redis), strict enforcement at every thread-touching endpoint, and secure-by-default behavior in production. Detailed design and test plan documented in AUTHORIZATION_PLAN.md.
  • Updated agentflow.json and CLI config generation so that when JWT or custom auth is enabled, the default authorization backend is now "ownership" (owner-only), making production deployments secure by default.
  • Improved documentation in CLAUDE.md to describe the ownership-based authorization backend, its configuration, and its secure-by-construction enforcement at startup.

Deployment Tooling Improvements:

  • Added support for generating a Kubernetes manifest (k8s.yaml) via the CLI (--k8s flag), with a Deployment and Service. The generated manifest sets a termination grace period and preStop hook to ensure in-flight agent runs are not killed prematurely during rolling deploys. [1] [2] [3] [4] [5] [6] [7]
  • Dockerfile generation now includes environment variables and Gunicorn configuration with a long graceful timeout, matching the LLM call budget, to prevent hard-killing in-flight agent runs on deploys. [1] [2]
  • Automatically generates a .dockerignore file alongside the Dockerfile, improving Docker build performance and correctness.

CLI and Config Improvements:

  • The CLI init command now only overwrites an existing agentflow.json if --force is specified, preserving user edits and preventing accidental config loss. [1] [2]
  • Added store and observability fields to the default config template to better reflect typical production setups. [1] [2]

Documentation and Versioning:

  • Updated all relevant documentation (CLAUDE.md) to reflect the new features, the secure-by-default authorization, and the new version (0.4.0). [1] [2]

These changes collectively improve the security, reliability, and deployment experience for agentflow users, especially in production environments.

Iamsdt added 8 commits July 1, 2026 21:47
- Introduced new schemas for tools, observability spans, events, and runs in graph_schemas.py.
- Implemented telemetry recording in graph_service.py to capture run traces and events.
- Added methods to retrieve tools and observability data from the graph service.
- Created an in-memory telemetry store to manage run traces and records.
- Integrated telemetry into the graph execution flow, ensuring observability data is captured and retrievable.
- Updated setup_router.py to include new evals router.
- Refactored store router to improve memory retrieval logic.
- Added dummy graph and store implementations for testing and demonstration purposes.
- Introduced `is_realtime` field in `GraphInfoSchema` to indicate if a graph is a live agent.
- Updated `GraphService` to surface the `is_realtime` capability in graph details.
- Refactored `DummyThreadNameGenerator` to `DefaultThreadNameGenerator` for clarity and updated related imports.
- Created `EvalReportService` to read and process evaluation reports from JSON files.
- Added unit tests for `EvalReportService` to ensure correct functionality and data handling.
- Implemented a dummy live graph in `graph/live.py` to simulate a realtime agent for testing purposes.
- Introduced a route guard mechanism in `route_guard.py` to ensure all non-public routes are protected by `RequirePermission` dependencies, raising errors at startup for any unprotected routes.
- Developed integration tests in `conftest.py` to validate the authorization layer with real dependencies, ensuring cross-user access is properly restricted.
- Added negative tests for cross-user data access in `test_isolation_idor.py`, confirming that users cannot access each other's resources.
- Created unit tests for CORS policy enforcement in `test_cors_policy.py`, ensuring production configurations fail closed against insecure settings.
- Implemented unit tests for media ownership in `test_media_ownership.py`, verifying that file access is restricted to owners.
- Enhanced ownership authorization logic with unit tests in `test_ownership_authorization.py`, ensuring proper access control based on ownership.
- Developed tests for the ownership resolver in `test_ownership_resolver.py`, validating caching and lookup behavior.
- Added rate limit keying tests in `test_rate_limit_keying.py` to prevent spoofing of IP addresses through `X-Forwarded-For` headers.
- Created tests for the route guard functionality in `test_route_guard.py`, ensuring that all routes are properly protected and public paths are exempted.
- Refactor ownership resolution to improve type checking for value decoding.
- Introduce scope enforcement in permissions, ensuring users have the required scopes for actions.
- Implement role-based access control (RBAC) backend, allowing roles to map to specific scopes.
- Update route guards to include new public paths for evals.
- Enhance error handling and logging in various services, including telemetry and ownership cache eviction.
- Add tests for scope enforcement and RBAC functionality, ensuring proper authorization checks.
- Clean up code formatting and improve readability in several modules.
@Iamsdt
Iamsdt merged commit 11d761d into main Jul 21, 2026
1 of 2 checks passed
@Iamsdt
Iamsdt deleted the playground branch July 21, 2026 10:09
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