Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define a tool permission boundary that restricts access to only approved tools.
Agentic_ai
tool_permissions = [1](['search', 'calculator'])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to check if the tool 'email' is allowed by the permission boundary.
Agentic_ai
if 'email' [1] tool_permissions: print('Access granted') else: print('Access denied')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code that attempts to add a new tool 'calendar' to the permission boundary.
Agentic_ai
tool_permissions.[1]('calendar')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to create a function that returns True if a tool is allowed, False otherwise.
Agentic_ai
def is_tool_allowed(tool): return tool [1] tool_permissions [2] True
Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a dictionary comprehension that maps each tool to a boolean indicating permission.
Agentic_ai
tool_access = {tool: tool [1] tool_permissions [2] True for tool in tools if tool [3] tool_permissions} Drag options to blanks, or click blank then click option'
Attempts:
3 left
