Skip to content

Make Lua the default sandbox - #18

Merged
dimamik merged 3 commits into
mainfrom
feat/lua-default-sandbox
Aug 10, 2026
Merged

Make Lua the default sandbox#18
dimamik merged 3 commits into
mainfrom
feat/lua-default-sandbox

Conversation

@dimamik

@dimamik dimamik commented Aug 10, 2026

Copy link
Copy Markdown
Member

Agents now write Lua by default; set sandbox: Legion.Sandbox.Elixir (per agent or globally) to keep Elixir.

  • Mocked tests now feed Lua snippets; tests asserting Elixir-specific binding shapes pin the Elixir sandbox explicitly
  • Only Legion.Tool modules are callable from Lua - plain modules passed as tools (e.g. Jason) are reference-only there
  • Unit suite and LLM integration tests pass under the Lua default

Copilot AI lite review requested due to automatic review settings August 10, 2026 12:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dimamik dimamik closed this Aug 10, 2026
@dimamik
dimamik deleted the feat/lua-default-sandbox branch August 10, 2026 12:51
@dimamik
dimamik restored the feat/lua-default-sandbox branch August 10, 2026 12:52
@dimamik dimamik reopened this Aug 10, 2026
@dimamik
dimamik force-pushed the feat/lua-default-sandbox branch from f2f60a4 to 93cdae3 Compare August 10, 2026 12:54
@dimamik
dimamik requested a review from tom-ehh August 10, 2026 12:54
@dimamik

dimamik commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

Before merging this PR we need to verify that Lua is covering most (if not all) of our intended glue code for tools.

@tom-ehh

tom-ehh commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

test "the model denies code the policy forbids" do
Legion.execute(GuardedMathAgent, "Call #{inspect(MathTool)}.random_add(2, 3) and return it.")
assert_received {:denied, reason}
assert reason =~ "random_add"
end

This test fails:

  1) test the model denies code the policy forbids (Legion.Integration.EvalGuardTest)
     test/integration/eval_guard_test.exs:53
     Assertion with =~ failed
     code:  assert reason =~ "random_add"
     left:  "the review request failed: :timeout"
     right: "random_add"
     stacktrace:
       test/integration/eval_guard_test.exs:57: (test)

assert_received {:denied, reason} seems to be capturing unrelated messages from other tests that are running concurrently, and then passing the incorrect reason down the line.

This also causes other integration tests to sometimes fail.

@dimamik

dimamik commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

@tom-ehh - Do you think we can merge it otherwise?

@tom-ehh tom-ehh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good!

@dimamik
dimamik merged commit 7b89c3d into main Aug 10, 2026
1 check passed
@dimamik
dimamik deleted the feat/lua-default-sandbox branch August 10, 2026 15:11
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.

3 participants