Changelog
View Sourcev0.4.0 - 2026-05-17
Security
- Harden
Legion.Sandbox.ASTCheckeragainst a class of RCE paths. After this release, most (if not all) RCE vectors should be closed. Legion is still vulnerable to DoS kinds of attacks, but we assume that having a system prompt instruction to behave well AND improving sandbox should be enough for now.
Changes
- Broaden the sandbox surface for common LLM idioms: allow
Map.values/1,JSON,URI,:erlang.float_to_binary/2, additionalString/Enum/Date/DateTimefunctions, and theAccessprotocol (map[:k]) - Document the sandbox constraints with concrete idioms in the system prompt
- Fix tool source extraction breaking on heredocs and charlists
- Correct documentation for telemetry events, source registry, and
AgentTool.start_link/2
v0.3.0 - 2026-04-21
Changes
- Replace
share_bindingsboolean withbinding_scope(:iteration,:turn,:conversation) for fine-grained control over variable lifetime across code executions - Add
action_types/0callback to restrict which actions an agent can use (e.g.~w(return done)for read-only agents) - Add
max_message_lengthconfig with truncation support to prevent unbounded message growth - Add multimedia message support:
{:image, data, media_type},{:image_url, url}, and{:multipart, parts} - Add
Legion.get_messages/1to retrieve conversation history from a running agent - Expand
AgentToolwithparallel/2,pipeline/1,then/3, andextra_allowed_modules/0for sub-agent orchestration; sub-agents are auto-aliased in the sandbox - Generate dynamic
AgentTool.description/0from sub-agent moduledocs - Move system prompt resolution to
AgentPrompt, respecting customsystem_prompt/0overrides - Validate config keys at startup with warnings for unknown keys
- Add
@moduledoccompile-time validation via__before_compile__ - Harden sandbox: block
def/defp/__ENV__, additional:erlangfunctions (process_flag,list_to_atom,system_info), catch throws and exits, surface compiler diagnostics on errors - Handle executor exceptions gracefully instead of crashing the agent loop
- Add
Calendarto sandbox safe-module list - Emit
:exceptiontelemetry events for iteration, LLM, and sandbox spans; useSystem.convert_time_unit/3for duration reporting - Extensive new test coverage for
AgentServer,Executor,Sandbox, andASTChecker
v0.2.1 - 2026-03-24
- Improve source code extraction for tool definitions
- Adjust system prompt to better reflect capabilities
v0.2.0 - 2026-03-15
Changes
- Simplified and refactored internals
- Improved documentation and general library intent
v0.1.0 - 2025-12-29
New 🔥
- Initial release of Legion - an Elixir-native agentic AI framework
Legion.AIAgentbehaviour for building AI agents with customizable tools and configurationsLegion.Toolbehaviour for defining tools that agents can use- Integration with
req_llmfor LLM communication Legion.Sandboxfor secure code evaluation using DuneLegion.call/2andLegion.cast/2for synchronous and asynchronous message passingLegion.start_link/2for spawning long-lived agents- Telemetry events for monitoring and debugging agent execution
- Support for agent-to-agent communication and delegation