def _CreateDescription(agent_rules, description):
  """Create description in guest policy.

  Args:
    agent_rules: agent rules in ops agent policy.
    description: description in ops agent policy.

  Returns:
    description in guest policy.
  """
  description_template = ('{"type": "ops-agents", "description": "%s", '
                          '"agentRules": [%s]}')

  agent_contents = [agent_rule.ToJson() for agent_rule in agent_rules or []]

  return description_template % (description, ','.join(agent_contents))