Skip to content

feat: comprehensive security hardening, flow expansion, test infra, CI, and bug fixes#1372

Closed
MD-Mushfiqur123 wants to merge 1 commit into
FoundationAgents:mainfrom
MD-Mushfiqur123:mega/security-flows-tests-ci
Closed

feat: comprehensive security hardening, flow expansion, test infra, CI, and bug fixes#1372
MD-Mushfiqur123 wants to merge 1 commit into
FoundationAgents:mainfrom
MD-Mushfiqur123:mega/security-flows-tests-ci

Conversation

@MD-Mushfiqur123

@MD-Mushfiqur123 MD-Mushfiqur123 commented May 20, 2026

Copy link
Copy Markdown

Summary

Comprehensive contribution covering security hardening, flow system expansion, test infrastructure, CI/CD, bug fixes, and developer documentation. 48 files changed, 1861 insertions.

Security Hardening

New exception hierarchy (app/exceptions.py):

  • ConfigError, LLMProviderError, AgentError, AgentStuckError, FlowError, MCPConnectionError, SecurityError, ValidationError, RateLimitError

New security module (app/tool/security/) — 5 classes:

  • InputValidator — validates tool inputs against schemas, detects dangerous commands and path traversal
  • Sanitizer — sanitizes commands, paths, shell args, and filenames; blocks rm -rf /, mkfs, fork bombs
  • RateLimiter — token-bucket rate limiter per tool with asyncio safety
  • AuditLogger — structured audit trail for tool execution, LLM calls, security events
  • OutputGuardrail — filters outputs (truncation, ANSI stripping, base64 blob detection)

Security middleware — integrated into BaseTool._execute_with_security():

  • All tool calls are now validated → rate limited → audited → output-filtered by default

Flow System Expansion

  • ParallelFlow — executes multiple agents concurrently, collects all results
  • DelegationFlow — primary agent delegates sub-tasks to specialized agents
  • HumanInTheLoopFlow — flow pauses at checkpoints for human review
  • FlowFactory — upgraded to class-based registry with register_flow() for extensibility

Bug Fixes

  • Daytona startup crash (closes Missing dependencies and Daytona SDK Authentication Crash on Startup #1361) — made Daytona() conditional on API key presence; added default value to DaytonaSettings.daytona_api_key
  • Missing deps — added structlog and daytona to requirements.txt
  • update_memory() — fixed passing base64_image to system_message() which doesn't accept it
  • MockLLM — fixed add_tool_call_response() to use Message.from_tool_calls() instead of Message.assistant_message()

Test Infrastructure

Mock framework (tests/mocks/):

  • MockLLM — configurable responses, tool call simulation, call history tracking
  • MockTool / FailingTool — for testing agent tool execution
  • MockConfig — factory + monkeypatch helper

129 tests across 14 test files — all passing:

  • Schema (18 tests), exceptions (7), config (7), base agent (12)
  • Security module (33 tests), security integration (5)
  • Parallel flow (3), delegation flow (4), human loop (3), flow factory (6)
  • Tool result (11), base tool (9), LLM/message (6), mocks (5)

Developer Experience

  • CONTRIBUTING.md — full contribution guide with setup, code style, PR process, test instructions
  • Environment variable configOPENMANUS_LLM_API_KEY etc. override TOML file settings
  • CI/CD — pytest + coverage matrix (3.11, 3.12) in pre-commit workflow

Related

Contributors

Testing

129 passed in 2.23s

@MohamedElsaeidy

Copy link
Copy Markdown

hey, i have been working alot and fixed those issues, you may want to contribute on my build Comit
my repo is here

- 33 security module tests (input_validator, sanitizer, rate_limiter, audit_logger, output_guardrail, integration)
- Flow tests: delegation, human_loop, flow_factory (13 tests)
- Tool tests: ToolResult, BaseTool, ToolCollection (15 tests)
- LLM/Message schema tests, Mock tests (11 tests)
- CONTRIBUTING.md with full developer guide
- Environment variable config overrides (OPENMANUS_LLM_API_KEY etc.)
- Fixed MockLLM.add_tool_call_response

Signed-off-by: god032396-del <god032396@gmail.com>
@MD-Mushfiqur123 MD-Mushfiqur123 force-pushed the mega/security-flows-tests-ci branch from ed0dac3 to 950ea7a Compare June 13, 2026 02:24
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.

Missing dependencies and Daytona SDK Authentication Crash on Startup

2 participants