0
0
Agentic_aiml~10 mins

Sandboxing dangerous operations in Agentic Ai - Interactive Code Practice

Choose your learning style8 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to safely execute a command in a sandboxed environment.

Agentic_ai
sandbox.execute([1])
Drag options to blanks, or click blank then click option'
A'ls -la'
B'shutdown now'
C'rm -rf /'
D'format C:'
Attempts:
3 left
2fill in blank
medium

Complete the code to restrict the sandbox to only allow read operations.

Agentic_ai
sandbox.set_permissions([1])
Drag options to blanks, or click blank then click option'
A'read-write'
B'execute-only'
C'read-only'
D'no-access'
Attempts:
3 left
3fill in blank
hard

Fix the error in the sandbox initialization to prevent dangerous code execution.

Agentic_ai
sandbox = Sandbox([1]=False)
Drag options to blanks, or click blank then click option'
Aallow_file_write
Benable_debug
Cenable_logging
Dallow_network
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a sandbox that limits CPU and memory usage.

Agentic_ai
sandbox = Sandbox(cpu_limit=[1], memory_limit=[2])
Drag options to blanks, or click blank then click option'
A50
B1024
C2048
D100
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to safely execute user code with timeout and restricted imports.

Agentic_ai
sandbox = Sandbox(timeout=[1], allowed_imports=[2], safe_mode=[3])
result = sandbox.run(user_code)
Drag options to blanks, or click blank then click option'
A5
B['math', 'random']
CTrue
DFalse
Attempts:
3 left