Overview
Use the Secret type for sensitive job parameters (passwords, tokens, community strings). It renders as a masked input field in the UI and prevents accidental exposure in logs.
Import
from comfy import job, Secret
How It Works
Declare a parameter as Secret instead of str. Netpicker handles the rest — the field is masked in the UI and the value is passed securely into your job. You can mix Secret and regular str parameters freely:
from comfy import job, Secret
@job(platform=['cisco_ios'])
def create_user(device, username: str, password: Secret):
device.cli.send_config_set([
f"username {username} privilege 15 secret {password}"
])
return f"User {username} created"
In the UI, username renders as a normal text field and password as a masked input.
Tip: Accessing the Raw String Value
In most jobs you can pass the Secret object directly and Netpicker handles it. If you ever need the raw string — for example, to build a custom payload or pass it to an external API — call .get_value():
real_value = password.get_value() # returns a plain str
print(real_value) # 1234
Note that printing the Secret object directly (without .get_value()) outputs ********, not the real value.
