<code>deny(agent, access, sensitive_data)</code> -> Option D
Quick Check:
Restriction means deny access = D [OK]
Hint: Deny means block access; allow means permit access [OK]
Common Mistakes:
Confusing allow with deny
Using permit for sensitive data access
Blocking public data instead of sensitive
3. Given this monitoring code snippet for an AI agent:
logs = []
for event in agent_events:
if event['type'] == 'error':
logs.append(event['message'])
print(len(logs))
What does the output represent?
medium
A. Total number of events processed
B. Number of error events detected
C. Number of successful events
D. Number of unique event types
Solution
Step 1: Analyze the loop filtering events
The code adds messages only if event type is 'error'.
Step 2: Understand the output
Printing length of logs shows how many error events were found.
Final Answer:
Number of error events detected -> Option B
Quick Check:
Count of error events = B [OK]
Hint: Count items filtered by 'error' type in logs [OK]
Common Mistakes:
Counting all events instead of errors
Confusing error messages with success
Assuming unique event types count
4. This deployment script snippet has an error:
def deploy_agent(config):
if config['secure'] = True:
print('Deploying with security')
else:
print('Deploying without security')
What is the error and how to fix it?
medium
A. Remove quotes around True
B. Change 'if' to 'while' loop
C. Use '==' for comparison instead of '='
D. Add colon after else statement
Solution
Step 1: Identify the syntax error in condition
The code uses '=' which is assignment, not comparison.
Step 2: Correct the comparison operator
Replace '=' with '==' to compare values properly.
Final Answer:
Use '==' for comparison instead of '=' -> Option C
Quick Check:
Comparison needs '==' not '=' = C [OK]
Hint: Use '==' to compare, '=' to assign [OK]
Common Mistakes:
Using '=' instead of '==' in if conditions
Confusing loop keywords
Missing colons in control statements
5. You want to deploy an AI agent in an enterprise that must comply with strict data privacy laws and require continuous performance monitoring. Which deployment approach best fits these needs?
hard
A. Deploy on-premises with strict access policies and real-time monitoring
B. Deploy on a public cloud with no monitoring tools
C. Deploy on a shared server with minimal security
D. Deploy on a local machine without logging
Solution
Step 1: Identify compliance and monitoring requirements
Strict data privacy laws require controlled environment and access policies.
Step 2: Match deployment environment and monitoring
On-premises deployment allows control; real-time monitoring ensures performance and safety.
Final Answer:
Deploy on-premises with strict access policies and real-time monitoring -> Option A