Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Having "*" in authorized_imports does not actually allow you to use any import #508

Open
CalOmnie opened this issue Feb 5, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@CalOmnie
Copy link
Contributor

CalOmnie commented Feb 5, 2025

Describe the bug
Having "*" in authorized_imports does not matter in get_safe_module

Code to reproduce the error
The simplest code snippet that produces your bug.

from smolagents import CodeAgent, HfApiModel
model = HfApiModel()
agent = CodeAgent(model=model, additional_authorized_imports=["*"], tools=[])
code = """
import os
print(os.getcwd)
"""
agent.run(f"Run the following code: {code}")

Error logs (if any)

Image

Expected behavior
I should be able to run the example when using "*"

Packages version:
Run pip freeze | grep smolagents and paste it here.
1.8.0

Additional context
Add any other context about the problem here.

@CalOmnie CalOmnie added the bug Something isn't working label Feb 5, 2025
@CalOmnie
Copy link
Contributor Author

CalOmnie commented Feb 5, 2025

Tentative fix: #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant