Self-Knowing Agents